[pmwiki-users] Hierarchical pages

Petko Yotov 5ko at 5ko.fr
Sat Apr 25 02:13:08 PDT 2020

I haven't received your message even after the mailing list was 
restarted, so I'm copying it from the list archive:

> I've been reading the pages about Hierarchical Groups and have tried
> both HG and Cluster.  It's possible (maybe likely) that I'm not
> understanding how these work or how to configure them to work the way I
> want.

I have never used these addons and haven't reviewed them, but you may be 
able to do the breadcrumbs with PmWiki core features -- WikiGroups and 

I'll explain below.

> I want to be able to create a tree of wiki pages and be able to walk
> back from a page to it's parent.  Something like this:
> Maps
>    |-- Europe
>        |-- France
>        |   |-- Paris
>        |       |-- 1950
>        |       |-- 2000
>        |-- Germany
>            |-- Berlin
>            |   |-- 1989
>            |   |-- 2019
>            |-- Munich
>                |-- 2019
> When I create a page, say the last 2019 page, I want it to have a name
> which reflects the hierarchical structure.  So [[2019]] on the Munich
> page should create and link to a page MapsEuropeGermanyMunich2019 (or
> something similar, with delimiters).

With the core (no hierarchical groups) you can have a WikiGroup 
[[Munich/]] and pages Munich.Munich, Munich.2019, etc. In the 
[[Munich/Munich]] page, typing [[2019]] will link to the Munich.2019 

The only problem is when there is another location named "Munich" 
somewhere else, and you need to have another WikiGroup. In this case you 
can select a different group name like MunichND for the city in North 
Dacota. (Or, one would be called "München" the other "Munich").

> On the MapsEuropeGermanyMunich2019 page, I'd like to see a breadcrumb
> which looks like Maps>Europe>Germany>Munich>2019, where each component
> points to the corresponding ancestor page in the tree.
> Is there any way to do this?

You can use a WikiTrail. Some manual editing is required to create and 
maintain the trail but then the breadcrumbs are automatic.

In your Maps.Maps page, you create a nested bulleted list with the 
structure, like this:

* [[Maps/Europe]]
** [[Maps/France]]
*** [[Paris/Paris]]
**** [[Paris/1950]]
**** [[Paris/2000]]
** [[Maps/Germany]]
*** [[Berlin/Berlin]]
**** [[Berlin/1989]]
**** [[Berlin/2019]]
*** [[München/München]]
**** [[München/2019]]

(If you don't want this to appear in your page, you can place it inside 
a (:if false:) conditional.

Then in every individual page, you use the "Path trail" markup with a 
link to the wiki trail.


See https://www.pmwiki.org/wiki/PmWiki/WikiTrails#path-trail

Obviously, you can place the markup inside a GroupHeader or a 
GroupHooter page in every city group, or find the recipe about enabling 
a shared SiteHeader for all groups.

Instead of the "One WikiGroup per city" structure you may decide to have 
one group per country, then have pages like France.Paris, then 
France.Paris1950. In the page Paris you'll need to write [[Paris 1950]] 
to make a link. Obviously, in your WikiTrail you'll need to link to the 
actual page names.


More information about the pmwiki-users mailing list