[pmwiki-users] question about view concept

Radu radu at monicsoft.net
Thu Aug 11 15:56:00 CDT 2005


At 09:38 AM 8/11/2005, Patrick R. Michaud wrote:
>Views are different from authorizations.  Authorization
>determines what a user is _allowed_ to perform, while
>views are a way of selecting or customizing a skin based
>on the types of actions the user _wants_ to perform.

...

>FWIW, I'm not entirely comfortable with the name "views"
>for this capability -- it doesn't seem to flow well when
>trying to describe what it does.  This often means it should
>be called something else.

I really hope I won't have people running after me with pitchforks 
for mentioning the following... but below is my current idea and how 
I've started implementing it. It's a combination of brainstorming and 
application.

Pm is right, views as 'modes' - as Bronwyn and Christian have been 
talking about them are really just ways for the skin to change 
depending on the current actions.

So I'm moving all 'mode'-related stuff over to the ?action= variable 
handling, and I'm adding a (sorry, currently confusing), ?view= 
variable in order to handle switching on and off certain (sets of) 
functionality. I am also placing user preferences in 
Profile.$Author-Preferences, that defaults to Site.Preferences.

So I'll have
:action=display: to take off all links and leave only a Login box at the bottom
:action=authoring: to show a few of the navlinks (what )
:action=admin: to show all navlinks, as Hans currently has it on 
http://www.pmwiki.org/wiki/Cookbook/ViewModes
:action=print: as it works by default currently

:view=edit: to add the EditForm to whatever action is currently on
:view=minicalendar: to add a mini-calendar to the
:view=format: to add options for the current skin in display and 
authoring, or add the formating toolbar to the edit form

(of course, what recipes are bundled would depend on the needs of 
each project; I'm suggesting a mechanism here, Bronwyn, not a bundle!!)

That way we have a 2-dimensional space defined by actions and tools 
one would need during those actions. The view variable would toggle 
(i.e. if the edit form is currently on, a call to ?view=edit would 
turn it off- e.g. Cancel functionality).

Now for the method:
* I don't like the CSS approach because it potentially places lots of 
unused code on the page, which is bound to trip screen readers the 
wrong way. And it's stuff sent to the client unnecessarily.
* That leaves two options, to balance based on personal preference:
** several templates (as not print is totally separate), or
** one template with lots of conditionals and/or includes

I'll probably go for a combination, dictated by what I want to place 
as author-editable stuff.

Currently I'm working on the last option I listed, and I would like 
to hear any gruesome stories from people who might have tried this, 
stories that would save me some trouble later on.


Cheers,
Radu
(www.monicsoft.net)  





More information about the pmwiki-users mailing list