[pmwiki-users] Per-Group Sidebars?

Tegan Dowling tmdowling at gmail.com
Sat Jul 15 11:22:48 CDT 2006


On 7/15/06, Marc Cooper <gmane at auxbuss.com> wrote:
> Patrick R. Michaud said...
> > On Fri, Jul 14, 2006 at 08:32:28PM +0100, Marc Cooper wrote:
> > > Patrick R. Michaud said...
> > > > On Thu, Jul 13, 2006 at 03:19:52PM -0500, Michael Gleicher wrote:
> > > > > Is it possible to specify a different sidebar to be used by a particular
> > > > > group?
> > > >
> > > > Sure, just create a page called "SideBar" in that group -- it will
> > > > replace the default Site.SideBar.
> > >
> > > An alternative way to do this is to remove the code in the skin that
> > > gives priority to $group.sidebar over $site.sidebar and embed the
> > > $group-specific sidebar code within the $site.sidebar with something
> > > like:
> > >
> > > (:if !group site :)
> > > (:include {$Group}.sidebar:) (:if:)
> >
> > Still another way to do it is to have the group-specific sidebar
> > use
> >
> >     (:include Site.SideBar:)
> >
> > at the appropriate place (usually either the top or bottom of
> > the group-specific sidebar).
>
> Ah ha. That's better in many cases, since it won't "break" existing
> templates - or require them to be changed.
>
> However, when the required sidebar contains site stuff, then (optional
> group stuff, then more site stuff, then it's not so clear.
>
> Of course, site.sidebar could then contain:
>
>   site stuff
>   (:include Site.SideBarMoreStuff:)
>
> and the group.sidebars
>
>   (:include Site.SideBar:)
>   group stuff
>   (:include Site.SideBarMoreStuff:)
>
> Just floating it out there ;-)

On most of my sites, the real, group-dependent content of the SideBar
is **included** via {$Group}/SideMenu (or Main/SideMenu).  Note that
the included "SideMenu" pages have no special wiki or html standing -
they're not identified in the skin's template or css, or anything like
that. Also (For clarity's sake I don't demonstrate this in the example
code below), the actual code on the Main and Site SideBars not only
includes SideMenu, but provides edit-authorized users with links to
edit SideMenu, GroupHeader and GroupFooter.

My sites use both a Main/SideBar and a Site/SideBar

1) I expect that most sites will have a "public face" and an
"insiders' face", and the pages in publicly-viewable wikigroups are
the ones most likely to be edited by more naive users, who would be
confused by having to go to Site/SideBar to change the material that
appears alongside the Main/HomePage (for instance).

2) Other "public face" wikigroups have SideBars that simply (:include
Main/SideBar:), and thus are consistent with the Main/SideBar in
having the same SideMenu material as the Main wikigroup (although
Main/SideMenu *could* have some group-dependent conditionals of its
own).

3) My Main/SideBar looks more or less like the following:

![[Main(.) Home Page]]
(:include Main.SideMenu:)

\\

----
(:if auth edit:)
(:include Site.ToolMenu:)(:if:)

4) the Site/SideBar has basically the following (so typically does not
display all of the site's "public face" SideBar material, as it
doesn't include Main/SideMenu):

!Back to [[Main(.) Home Page]]

![[{$Groupspaced}(.HomePage)]]
(:include {$Group}/SideMenu:)

\\

----
(:if auth edit:)
(:include Site.ToolMenu:)(:if:)

5) Site/ToolMenu has these helpful links (and per the code above, is
displayed in any SideBar whenever the user is authorized to edit the
page he/she is viewing):

! [-Website Activity & Navigation-]
''Activity''(:if exists {$Group}.RecentChanges:)
* [[{$Group}/Recent Changes |''{$Groupspaced} group'' Recent
Changes]](:if auth admin:)
* [[Site/All Recent Changes]](:if:)

''What's Where''
* [[{$Name}?action=search&q=link={$FullName}+list=all | $[Backlinks]]]
(see links to this page)
* [[{$Name}?action=search&q=group={$Group}+list=all | ''{$Groupspaced}
group'' Index]]
* [[Main/SiteIndex | wiki-wide Index]]




More information about the pmwiki-users mailing list