[pmwiki-users] Re: Wikified action lists

Bronwyn Boltwood arndis at gmail.com
Thu Aug 4 12:54:40 CDT 2005


On 8/4/05, chr at home.se <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?
> 
> As a second step, I'd probably like to do the same thing all over for a
> list of groups.... I.e. the sidebar contains something like:
> 
>         Important groups:
>         * [[Group A]]
>         * [[Group B]]
>         * [[Group C]]

The first thing is to find or create a hook for the CSS rule(s) to
select.  You might be able to do it with conditional markup, but I
would start by looking at the "mark and undo self-links" code in
Markup Extensions.  You need to
- find out the current field and group from PmWiki
- in the current output, find links to those pages
- mark those links with a class like "active"
- write a CSS rule that selects the proper links in the sidebar, and
changes the appearance as you desire.  Exactly what the selector
should be depends on the HTML structure, and therefore the skin.

You could also make the active styling for the field and group
different from eachother, through one of two methods:
- if your HTML structure permits, write a CSS rule that selects and
styles the field, and another for the group.
- if your HTML structure is not fine-grained enough for that, then
make two versions of the snippet you'll need, and have them apply
different classes, like "activefield" and "activegroup", and then
write separate rules for each of those.

I can help with the CSS if you get stuck.

Bronwyn




More information about the pmwiki-users mailing list