[pmwiki-users] Hg development...

The Editor editor at fast.st
Mon Mar 19 12:53:59 CDT 2007


Still tinkering with some nice new features in Hg, taking advantage of
the technique I used in ZAP to create Site configuration pages.
Namely an extremely flexible system for aliasing breadcrumbs and for
assigning grouptitles. I've also rewritten the Hierarchical Groups
recipe page to give more information about the various related
recipes.

Cheers,
Dan



>From the recipe page:

BreadCrumbs

Hg is designed to give you easy BreadCrumbs, while still allowing
great flexibility. To set up a basic BreadCrumb effect, simply put the
(:breadcrumb:) markup on your page. It will create a pretty, clickable
trail like Group > SubGroup > SubSubGroup > Name. That's all you need
to do! You can Enable/Disable the display of the page name using the
$EnableBreadCrumPageName variable in a config file. However, you can
do much more...

If you create a page called Site.HgBreadCrumbs, you can use text
variables to do full aliasing of how each element in the breadcrumb
looks. For example, suppose you are on page Main-Hide-Start.HomePage,
then on Site.HgGroupTitles, you could put

 Main:  [[Main.HomePage|Welcome]] >
 Hide:
 Start:  [[Somewhere.Else|Getting Started]] >

In this case, the breadcrumb would output Welcome > Getting Started >
HomePage (with appropriate underlying links. The Hg breadcrumb also
uses $Title rather than $NameSpaced (cluster), so you can change
HomePage to something different as well.

In situations where you need extra flexibility, you may wish to
consider a hierarchical page variable (see above), and insert it into
your skin where desired. Then at the default $SiteGroup.BreadCrumb
location (different from page BreadCrumbs), add the (:breadcrumb:)
markup. Hg will then enable you to overwrite it in any child groups
you wish, just as it does with sidebars and sidemenus--allowing you to
create fully customized breadcrumbs wherever needed.

Group Titles

Hg is designed to also make it easy to assign custom titles to
specific groups, and make them hierarchical as well. At the easiest
level, just add {$grouptitle} to your page, and the last subgroup will
be returned as the group title. Again, however, you can do more...

If you create a page called Site.HgBreadCrumbs, you can list any group
you like as a text variables, and supply it a group title. So you
could, for example put

 Kindgom: Apple
 Kingdom-Animal: Orange
 Kingdom-Animal-Canine: Banana
 Kingdom-Plant:

Then pages in the appropriate groups will return the appropriate
values for {$grouptitle}. You can even include most markup! However,
since these group titles are hierarchical, a page in group
Kingdom-Test will also return Apple. If a value is cleared for a
specific group (like Kingdom-Plant), you will get the default value
(Plant), for that group, and all descendent groups. IE, in
Kingdom-Plant-Grass you would get Grass.



More information about the pmwiki-users mailing list