[pmwiki-users] Recipe name? (Was: Wikified action lists)

chr at home.se chr at home.se
Thu Aug 4 12:58:32 CDT 2005


On Thu, 4 Aug 2005, Patrick R. Michaud wrote:

> On Thu, Aug 04, 2005 at 06:55:33PM +0200, chr at home.se wrote:
> > I'm looking for something that I think is slightly related to the above 
> > (but I'm not really sure since I haven't followed this thread..).
> > 
> > In my site, I have two fields, and a part of the sidebar that is common to
> > all fields and groups, namely this:
> > 	...
> > 	Fields in this site:
> > 	* [[User's field -> users:Main/HomePage]]
> > 	* [[Developer's field -> devel:Main/HomePage]]
> > 	...
> > 
> > what I'd like is some way to emphasize the active field, i.e. if the 
> > current field is the user's field, that item should be in bold or 
> > something. Any ideas?
> 
> Once again, wikistyles are your friend:
> 
>     Fields in this site:
>     * %userfield% [[User's field -> users:Main/HomePage]]
>     * %devfield% [[Developer's field -> devel:Main/HomePage]]
> 
> Then, in the user's field define the %userfield% wikistyle and leave
> %devfield% undefined; in the developer's field define the %devfield% 
> wikistyle and leave %userfield% undefined.

Dough.. (or is it just duh?). My problem was that I didn't realize that
undefined wiki styles won't have an effect - I thought I'd have to define
all of them in all fields etc.

Anwyway, this is very nice and even scales to groups. I'm sharing the
group Site/ to all fields on the site and I was actually already planning
to have a "distributed" sidebar. If we assume that there are two fields
called 'A' and 'B', we'd have these pages:

	Site.SideBar		- global sidebar, common to all fields
	A:Field.SideBar-field	- part of sidebar specific to field A
	B:Field.SideBar-field	- part of sidebar specific to field B
	A:GroupA.SideBar-group	- part of sidebar specific to A:GroupA/
	A:GroupB.SideBar-group	- part of sidebar specific to A:GroupB/
	A:GroupC.SideBar-group	- part of sidebar specific to A:GroupC/
	B:GroupD.SideBar-group	- part of sidebar specific to B:GroupD/
	B:GroupE.SideBar-group	- part of sidebar specific to B:GroupE/
	B:GroupF.SideBar-group	- part of sidebar specific to B:GroupF/

The global page Site.SideBar is really more of a template for the sidebar,
where the pages are included as follows:

	Site.SideBar
	  `-- Field.SideBar-field
	        `-- {$Group.SideBar-group}

So all that's needed now is that the pages Field.SideBar-field should
define wikistyles called %field-A% and %field-B% respectively. The primary
sidebar page, Site.SideBar, can then contain

	Fields:
	* %field-A%[[Field A -> A:Main/HomePage]]%%
	* %field-B%[[Field B -> B:Main/HomePage]]%%

	(:include Field.SideBar-field:)

and in A:Field.SideBar-field, I place

	Groups:
	* %group-A%[[GroupA/Group A]]%%
	* %group-B%[[GroupA/Group B]]%%
	* %group-C%[[GroupA/Group C]]%%
	
	(:include {$Group}.SideBar-group:)

where the corresponding pages, {$Group}.SideBar-group, need to define the 
wiki style for their group.

If anyone can come up with a good name for a cookbook page, I can add this 
principle for how to structure your sidebar there.

/Christian

PS. I am thinking of using a centralized strategy for the sidebar pages,
i.e. placing them in Field/ rather than in the different groups. The 
advantage is that you get less clutter in each group. You'd have something 
like:

	Site.SideBar			- common sidebar template
	A:Field.SideBar-field		- part specific to field A
	A:Field.SideBar-group-GroupA	- part specific for group A
	A:Field.SideBar-group-GroupB	- part specific for group B
	A:Field.SideBar-group-GroupC	- part specific for group C
	B:Field.SideBar-field		- part specific to field B
	B:Field.SideBar-group-GroupD	- part specific for group D
	B:Field.SideBar-group-GroupE	- part specific for group E
	B:Field.SideBar-group-GroupF	- part specific for group F

a minor drawback here is that you need to use fully qualified page links 
from Field.SideBar-group-... pages.

You can centralize this even further, putting all the sidebar pages in the 
group Site/.

	Site.SideBar			- common sidebar template
	Site.SideBar-field-A		- part specific to field A
	Site.SideBar-field-A-group-GroupA	- part specific to group A 
	Site.SideBar-field-A-group-GroupB	- part specific to group B 
	Site.SideBar-field-A-group-GroupC	- part specific to group C
	Site.SideBar-field-B-group-GroupA	- part specific to group A 
	Site.SideBar-field-B-group-GroupB	- part specific to group B 
	Site.SideBar-field-B-group-GroupC	- part specific to group C

Here you should probably remember to use intermap prefixes to qualify 
links so that they work from any field - just in case.

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






More information about the pmwiki-users mailing list