leiger wrote on 28 Mar 2010 12:47
Is there any way to avoid using cookies (which are browser-dependent) and to instead work on a username-dependent level? For example, numberperpage:leiger has the %%content%% value of 30.
How would it be possible to access such a value using the ListPages module's perPage attribute? Obviously that is not possible at the moment - but can a design be written that makes such a thing possible?
I could then have a page for every user in the "settings" category, with a Data Form asking them to select various settings for the website. ListPages would access things like:
- %%form_data{number-of-wishes-perpage}%%
- %%form_data{number-of-recent-comments-to-show-on-homepage}%%
Etc.
Dynamic content, defined by what the user wants to see — for site admins that know they can't suit everyone with just one, default setting.
Actually, I just re-read your post Gabrys… sounds like that cookie idea might end up doing exactly what I want to achieve.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I like this idea better than the cookie idea (although cookies would be useful for other things), but accessing them needs to be more general.
How-about if there was a list of user-variables in the wikidot profile — some generic stuff — and then site admins could add items to that list for members of their site.
So every wikidot member has a {$items-per-page} variable, but members of the site have a {$wishes-per-page} variable too.
(If we make it a {$xxx} variable, then it can be used in both pages and templates.)
Then we need a way of defaulting variable values:
The user variables are substituted after include processing then, if a [[defaults]] block is found on the page, those variable replacements are made. You can re-use the code that does include processing — the logic is identical.
So we need a new profile page for everyone, and a new page per site, to set variable values. We need a new Admin-accessible page to specify the variables, and we need a bit of cheap page processing.
But we don't need any updates to ListPages or any other module, and it is a whole lot more general.