Wikidot Design & Development

Customisable pages with member options

Give your users more control with per-page options.

I recently discovered that you can use a ListUsers module inside a ListPages module if the former is on the page you are selecting in the latter. I’m not sure if I have come across this before; chances are I have, but yesterday I actually had an application for it. Custom options for logged-in users.

With the new set-tags buttons, we can now allow registered users to customise a page. This requires a ListUsers module, containing the options for customisation, and iftags, containing the customisations themselves. While on some pages it might be fine to show the customise options all the time, on others (such as a home page) they are an unnecessary distraction that should be hidden unless the user has clicked through to them. Enter my latest discover.

We can have the customise options in a ListUsers module on a separate page, and select them onto the page to be customised with a ListPages module, only showing the module body when a parameter is passed via the URL (as we did here).

I’ll attempt to explain how this is achieved in the code below, but it might be easier to understand by looking at this example I’ve setup on the home page.

Site design © BMC WebDesign, 2011. All rights reserved. All tutorials on this site are free for commerical use, subject to conditions outlined in the disclaimer.