[pmwiki-users] Getting the trail page from a pagelist, eliminating returns

Martin Fick fick at fgm.com
Wed Jan 4 16:44:26 CST 2006


  I realize I might be trying to be a little too clever, but
I am attempting to use the new pagelist template code to
create trail markup such as:

<< prev | TrailPage | next >>

  You can see my first attempt on the
PagelistTemplateSamples page. It currently looks like this:

Definitions:

    [[#trailprev]]\
    (:if equal {>$FullName} {$FullName}:)<< [[{=$FullName}]]\(:if:)\
    [[#trailprevend]]
    [[#trailnext]]\
    (:if equal {<$FullName} {$FullName}:)[[{=$FullName}]] >>\(:if:)\
    [[#trailnextend]]

Mmarkup:

    (:pagelist fmt=PagelistTemplateSamples#trailprev trail=Cookbook:) |
    [[Cookbook]] | (:pagelist fmt=PagelistTemplateSamples#trailnext
    trail=Cookbook:)

Output:

      << Cookbook.PagelistExplained
      | Cookbook | 
      Cookbook.PageListWikiTrail >>


I am close, but a few glitches:


1) The first problem is that I have now way of knowing
   inside of a pagelist which page was used to supply the
   trail, so I had to split my markup in two.  Ideally, some
   variable such as {$Trail} would be avaiable so that I can
   get that value and only have to create one markup like
   this instead:

    [[#trail]]
    (:if equal {>$FullName} {$FullName}:)<< [[{=$FullName}]] (:if:)
    (:if equal {=$FullName} {$FullName}:)| [[{$Trail}]] |(:if:)
    (:if equal {<$FullName} {$FullName}:) [[{=$FullName}]] >>(:if:)
    [[#trailend]]


   Maybe making all the pagelist options including search
   terms available to the template would be neat?
   

2) Since this is not available, back to splitting it into
   prev and next markups.  Should I not be able to get a
   pagelist which does not create a return before and after
   the pagelist?  I tried putting slashes everywhere with
   no success.

   
   Getting both of these options to work would allow anyone
   to easily customize a trail, maybe they want to display
   it like this:
  
    << 1 2 3 4 | TrailPage | 6 7 8 9 >>
  
   or use titles... many possibilities,


   -Martin




More information about the pmwiki-users mailing list