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

chr at home.se chr at home.se
Sun Aug 7 14:40:09 CDT 2005

On Sun, 7 Aug 2005, Hans wrote:

> Well it sounds to me that what you are looking for can be achieved
> with creating variations to  a skin,

Yes, it can be done with skin variations (I'm just trying to avoid
focusing on the solution before I know what would be good).

> and changing between these using action links like
> [[{$Name}?setskin=adminmode| Admin mode]] or [[{$Name}?skin=adminmode|
> Admin mode]] (just for this page, not setting a cookie),
> or using markup conditions like
> (:if auth admin:)(:skin adminmode:)(:if:) or
> (:if skin admin:)..special admin links..(:if:)
Yes, but I'm not sure the mode should be so closely integrated with a
skin. That might be a good way to solve, but I don't know that.  In
addition, I feel that a mode is logically separate from the choice of

> 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:)

Unless I'm missing something here in how skins are named of course...

> In my skin development efforts I was trying to separate functionality
> like action lists from the look of the skin, so each can be determined
> independently. Having done so conditional markup is the perfect way to
> combine the two again.

Oh, I agree here. I'd just like another kind of separation. In this case 
you could say that the action lists would simply be mode dependent. (Well, 
that'd be one aspect at least).

> 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).


Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

More information about the pmwiki-users mailing list