[pmwiki-users] Using WikiTrails and PageList to Compile Pages

Peter Bowers pbowers at pobox.com
Mon Mar 19 02:57:32 CDT 2012


On Mon, Mar 19, 2012 at 7:18 AM, Jasyn Jones <jasynj at gmail.com> wrote:
> 1. I would like to insert the title—set via (:title :) on each separate page—as a header, right before the content from that page.
>
> I gather, from the documentation, this involves a custom PageListTemplate, but I cannot figure out (based on the examples) where to create that page, what it should be named, or what the markup should be.

Here's an example of the content of a pagelist page that to my eye
*should* work but obviously I'm missing something since the titles
don't show up (although the FullName shows up without difficulty)...
Maybe I've got an errant recipe on my system or maybe I'm makng some
obvious error -- hopefully this should get you started in the right
direction or someone else can point out what mistake I'm making...

===(snip)===
(:pagelist name=Test.*Title* fmt=#foo:)

(:if false:)
[[#foo]]
!! {=$TitleSpaced} {=$Title} {=$FullName}
(:include {=$FullName}:)

[[#fooend]]
(:ifend:)
===(snip)===

(Obviously you'll change the name= to your trail=)

This is an example of how to put the custom pagelisttemplate on the
same page where you are using it.  If you find that you will use this
template in pagelists from other pages as well then you should include
it in the page Site.LocalTemplates or else specify it by saying
fmt=X.Y-trailIndex#foo.

> 2. When I compile all the pages, it includes the TrailIndex links with each page. I would like to suppress those, if possible.
>
> Again, I gather this could be implemented in a custom PageListTemplate, but I can't figure out the markup.

There's a more elegant way to do this I'm sure, but here's something
that should work...

On each page instead of just having (:include X.Y-TrailIndex:) you
would have this:

(:if ! equal "{*$:SuppressTOC}" 1:)(:include X-Y-TrailIndex:)(:ifend:)

Then on the page where you want the compilation you would make sure to
have this markup somewhere on the page

(:SuppressTOC:1:)

Or you could probably put the (:if ...:)...(:ifend:) on the
X.Y-TrailIndex page itself (with the content of the TOC between
between hte if and the ifend) and that way you wouldn't have to
remember to put the if...ifend on each detail page.  That would save
you some effort and the possibility of a lot of errors.  I haven't
tested that, but I can't think why it wouldn't work...  It would also
give you the flexibility of putting some alternate text in place of
the TOC via (:else:) if you ever wanted to do that...

-Peter



More information about the pmwiki-users mailing list