Summary: Talk page for DynamicTrails.
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.


Note that this recipe may not work for you if (:pagelist:) is set to not return the current page in its results, Normally this would be fixed by modifying $SearchPatterns in your config.php.

I'm currently using this recipe on my site for Dynamic trail of form <<prev | Group | next>> but I made a small change to replace the "prev" and "next" with the page names of the prev and next pages. The change I made:

Replace this

%wikitrail%[[{<$FullName}| &laquo; prev ]] | [[{*$Groupspaced}]] | [[{>$FullName}| next &raquo; ]]

with this

%wikitrail%[[{<$FullName}| &laquo; {<$Namespaced} ]] | [[{*$Groupspaced}]] | [[{>$FullName}| {>$Namespaced} &raquo; ]]

The only problem I'm having with this recipe is that list=normal results in hiding the trail, even with the default template. The only workaround I can find is to use (:pagelist group={*$Group} name=-GroupHeader,-GroupFooter fmt=#grouptrail:) to remove certain pages from the pagelist. It works so it's not a big problem. Ian MacGregor

list=normal excludes the current page. You must either change your definition of $SearchPatterns['normal'] or, preferably, define a new pattern with this line(s) in config.php:
$SearchPatterns['trail'] = array('recent' => '!\.(All)?Recent(Changes|Uploads)$!',
  'group' => '!\.Group(Print)?(Header|Footer|Attributes)$!');
then in your pagelist markup use list=trail (:pagelist ... list=trail:)Peter Bowers August 07, 2010, at 04:28 PM
The syntax given above is a bit different from that in the SearchPatterns recipe, which shows the following:
           $SearchPatterns['normal'][] = '!\.(All)?Recent(Changes|Uploads)$!';
           $SearchPatterns['normal'][] = '!\.Group(Print)?(Header|Footer|Attributes)$!';
From this, I infer that the trail search pattern could be specified as:
           $SearchPatterns['trail'][] = '!\.(All)?Recent(Changes|Uploads)$!'; # don't list change pages
           $SearchPatterns['trail'][] = '!\.Group(Print)?(Header|Footer|Attributes)$!'; # don't list GroupHeader, GroupFooter, GroupAttributes
           $SearchPatterns['trail'][] = '!\.Template.*$'; # don't list pages like Cookbook.Template
           $SearchPatterns['trail'][] = '!^Profiles\..*-Contrib$!'; # don't list pages with author's contributions
           $SearchPatterns['trail'][] = '!-Talk$!'; # don't list pages that end in -Talk
Do the sub-array elements' names matter? (I.e. $SearchPattern['trail']['recent'] and $SearchPattern['trail']['group'])
--tamouse September 19, 2011, at 09:37 AM

2010-08-07 Peter Bowers
I prefer using $Titlespaced as seemingly the most user-friendly view of the name of the page. Here's my definition:

(:template each :)
(:if equal {*$FullName} {=$FullName}:)
[[{<$FullName}|&laquo; {<$Titlespaced}]] | '''{*$Titlespaced}''' | [[{>$FullName}|{>$Titlespaced} &raquo; ]]

Found a way to have looping trails. Here how I did it:

(:template first:)
(:if equal {*$FullName} {=$FullName}:)
(:pagelist link={$$link} order=-name count=1 fmt=#grouptrailHelper PrevName="" IndexName={*$Groupspaced} NextName={>$FullName}:)
(:template each:)
(:if equal {*$FullName} {=$FullName}:)
(:if2 ! equal {<$FullName} ".":)
(:if3 ! equal {>$FullName} ".":)
%wikitrail%< [[{<$FullName}]] | [[{*$Groupspaced}]] | [[{>$FullName}]] >
(:template last:)
(:if equal {*$FullName} {=$FullName}:)
(:pagelist link={$$link} order=name count=1 fmt=#grouptrailHelper PrevName={<$FullName} IndexName={*$Groupspaced} NextName="":)

(:if equal {$$PrevName} "":)
%wikitrail%< [[{=$FullName}]] | [[{$$IndexName}]] | [[{$$NextName}]] >
%wikitrail%< [[{$$PrevName}]] | [[{$$IndexName}]] | [[{=$FullName}]] >

I completely failed attempting to set this up using (:include:). It works like a charm if every page in the pagelist has the markup (though I had to enclose the whole thing in (:if false:)...(:ifend:) to avoid (:template each:) in the rendered page). However, of course having ever page have the markup almost defeats the whole purpose of this recipe. Any ideas? Rob Iverson, November 7, 2012, at 10:09 AM

Talk page for the DynamicTrails recipe (users?).