[pmwiki-users] selfgroup class & $GroupHeaderFmt

Patrick R. Michaud pmichaud at pobox.com
Mon Mar 6 16:56:33 CST 2006


On Mon, Mar 06, 2006 at 07:22:20PM +0100, noskule wrote:
> hi list
> I would like to use  a page like left sidebar or  HorizontalNav (in 
> NetstreamsSkin) as kind of sitedirectory that shows the existing 
> groups(with links  points to there homepages) an highlights the current 
> group. So with selflink I can highlight the current page. Now, is there 
> a way tho hilight  Links that points to homepages  if there groupname is 
> equal with the name of the current group?  It could probably be done 
> with conditional markup, but the problem there is to overwrite  the 
> linkclass via css, cause every link is allready specified. Most nice it 
> would be if it could assigned to  *.PageName via skin.php

Awww, it's easy.  Try formatting your sidebar this way:

    %define=hl-{$Group} bgcolor=yellow%

    * %hl-Main% [[Main.WikiSandbox]]
    * %hl-Main% [[Main.HomePage]]
    * %hl-OtherGroup% [[OtherGroup.SomeWhere]]
    * %hl-OtherGroup% [[OtherGroup.SomeWhereElse]]
    * %hl-PmWiki% [[PmWiki.DocumentationIndex]]
    * %hl-PmWiki% [[PmWiki.BasicEditing]]

When  you're in the Main group, the Main.* entries will be highlighted,
when in the PmWiki group, the PmWiki.* entries will be highlighted, etc.

Of course, you can also do things like:

    %define=hl-{$Group} bgcolor=yellow%

    >>hl-Main<<
    * [[Main.WikiSandbox]]
    * [[Main.HomePage]]

    >>hl-OtherGroup<<
    * [[OtherGroup.SomeWhere]]
    * [[OtherGroup.SomeWhereElse]]

    >>hl-PmWiki<<
    * [[PmWiki.DocumentationIndex]]
    * [[PmWiki.BasicEditing]]
    >><<

and it will just highlight the appropriate section.

There are, of course, *lots* of other ways to do this, but this
is the one that popped up in my head first.

> somthing else . .. I did try to disable GroupHeaderFmt in skins.php, but 
> this didnt work. In config php it works.
> 
> $GroupHeaderFmt = '';
> $GroupFooterFmt = '';
> 
> Could this somhow also be done in skins.php or are there reasons to not 
> do it?

In skins.php you have to declare any global variables, thus it
should be

    global $GroupHeaderFmt;
    $GroupHeaderFmt = '';

Or, use     

    $GLOBALS['GroupHeaderFmt'] = '';

Pm




More information about the pmwiki-users mailing list