[pmwiki-users] Trail markup using a page list as trail index

Petko Yotov 5ko at 5ko.fr
Sat Jan 6 01:27:55 PST 2024


To summarize this thread, it was possible to configure a dynamic trail 
without installing additional recipes.

The index page contains such a pagelist (simplified):

   (:pagelist group=Group "phrase search" fmt=#title list=normal:)


The group footer contains such a pagelist (simplified):

   (:pagelist group=Group "phrase search" fmt=#dyntrail 
name=-IndexPage,-GroupFooter:)

Here we omit "list=normal" which excludes the current page, which needs 
to appear it in our list. We also exclude the index page and GroupFooter 
which both contain the searched phrase.


The template looks like this (simplified):

   [[#dyntrail]]
   (:template each:)
   (:if equal {*$FullName} {=$FullName}:)
   %wikitrail% <[[{<$FullName}|+]] | [[IndexPage|+]] | 
[[{>$FullName}|+]]>
   (:ifend:)
   [[#dyntrailend]]

This is based on Cookbook:DynamicTrails.

Petko

-- 
If you upgrade :  https://www.pmwiki.org/Upgrades

On 04/01/2024 17:46, Gregor Klarič wrote:
> As far I see what the recipe does (among other execution paths) is to
> read in the trail page source and then determine, if there are page
> lists in the page and then convert those pagelists to wiki code and
> afterwards  feed it to the functions, which handle the trails
> generation.
> I transferred the (as far as I could tell) relevant code to the
> trails.php script, but unfortunately I wasn't able to get it to
> work....
> 
> Am Do., 4. Jan. 2024 um 06:53 Uhr schrieb Gregor Klarič
> <klaric.gregor at gmail.com>:
> 
>> OK, I understand, I misread the description on the WikiTrails page
>> and thought I could use a pagelist as a trail source.
>> 
>> So I found this old recipe
>> https://www.pmwiki.org/wiki/Cookbook/PageListWikiTrail
>> I guess I could use this if updated to run on the current wiki
>> version and php?
>> 
>> Am Mi., 3. Jan. 2024 um 20:57 Uhr schrieb Petko Yotov <5ko at 5ko.fr>:
>> 
>>> The WikiTrail page really needs to have a bulleted list of links
>>> to
>>> other pages, a pagelist is not recognized.
>>> 
>>> To use a pseudo-trail from a pagelist, check Dynamic trails:
>>> 
>>> https://www.pmwiki.org/wiki/Cookbook/DynamicTrails
>>> 
>>> There are other recipes but this one doesn't need to install
>>> anything,
>>> just configure Site.LocalTemplates and GroupFooter.
>>> 
>>>> (:if intext ': užitna' {$FullName}:)
>>> 
>>> I think you probably mean {*$FullName} not {$FullName} here.
>>> {*$FullName} means the browsed page, {$FullName} is normally
>>> GroupFooter.
>>> 
>>> Petko
>>> 
>>> On 03/01/2024 20:43, Gregor Klarič wrote:
>>>> Hello,
>>>> 
>>>> I am trying to use trail markup
>>>> https://www.pmwiki.org/wiki/PmWiki/WikiTrails
>>>> using a page list as trail index, but it is not working.
>>>> 
>>>> In the group footer page https://www.gobe.si/Gobe/GroupFooter I
>>> am
>>>> using this condition:
>>>> 
>>>> (:if intext ': užitna' {$FullName}:)
>>>> 
>>>> %center%<<|[[Gobe/UzitneGobe|+]]|>>
>>>> 
>>>> (:ifend:)
>>>> 
>>>> The condition itself works, if the text is found in the page.
>>> But only
>>>> the link to the trail page is displayed and not the links to the
>>>> previous and next page.
>>>> 
>>>> See for instance https://www.gobe.si/Gobe/AgaricusBisporus
>>>> 
>>>> I am using pmwiki-2.3.15.
>>>> 
>>>> What am I doing wrong?
>>>> 
>>>> Kind Regards,
>>>> Gregor



More information about the pmwiki-users mailing list