[pmwiki-users] Re: Re: Re: Re: Supporting different modes in default pmwiki

Bronwyn Boltwood arndis at gmail.com
Sun Aug 7 16:36:34 CDT 2005


On 8/7/05, chr at home.se <chr at home.se> wrote:
> On Sun, 7 Aug 2005, Hans wrote:

> > So do we need a 'mode' global variable(array) and conditional markup?
> > As I am trying to show, it is not really necessary. All can be
> > achieved with the existing tools.
> 
> For instance, if I write something like
> 
>         (:if skin admin:)... special admin link (:if:)
> 
> I'll have locked that code to a particular skin rather than a mode. So if
> the site has two skins that both support an author mode, the code above
> wouldn't work. It'd have be something like
> 
>         (:if skin cooladmin:)... special admin link (:if:)
>         (:if skin plainadmin:)... special admin link (:if:)
> 
> whereas with a mode variable, it'd stay like this, regardless of skin:
> 
>         (:if mode admin:)... special ... (:if:)

This pinpoints the weakness of Han's proposal. 

> > A 'mode' variable would need to define a mix of looks and functionality,
> 
> Oh.. that's not at all what I'm thinking of here. The mode variable could
> simply be a string that may take on of the values "reader", "author"  or
> "admin". It would then be up to the skin to recognize this variable and
> optionally produce different sub-skins. If it's desired, different skins
> can suppor different sets of modes (or none at all). I would however think
> it'd be nice if we had a standard set of modes that skins at least should
> recognize (even if they don't change).

Hans, the other day you wrote that you wanted standard wikipages for
action lists and other skin furniture.  This is just a different kind
of skin furniture, and standards will be equally beneficial.  Having a
standard set of modes gives both users and skin authors a baseline for
what modes are most important and what kinds of features they need. 
It is then up to the skin authors to choose what modes they'll support
in a skin, or even create new modes.

Assuming that $PmWikiMode and (:if mode:) existed, here's how I'd
integrate mode changes into a skin:
- <body class="$action $mode"> in the template, to provide style hooks
(I recently stole this beaut from FlexiSkin)
- css rules that made use of those selectors to hide or display
relevant content, like "body.read div#sidebar div#admin
{display:none;}"
- conditional markup with lots of (:if mode:) in the skin furniture pages

Bronwyn




More information about the pmwiki-users mailing list