[pmwiki-devel] Detecting existence of Trail
Martin Fick
mogulguy at yahoo.com
Mon Jun 25 13:31:30 CDT 2007
--- Kathryn Andersen
<kat_lists at katspace.homelinux.org> wrote:
> Is there some way that I can detect the existence of
> a trail on a given page? I know that if I do a
> pagelist where trail=Some.Page and there
> isn't a trail then there won't be any output. But
> is there some way of creating an (:if condition:)
> that will detect that?
I don't know of any way yet outside of a pl template
to do this, but I think that you can get what you want
by using the pagelist template, see below...
> The reason I want this, is that I want to be able to
> say
>
> if there is a trail on the current page
> do nothing
> else
> do this pagelist
> ifend
>
...
> (:pagelist group=Books link={*$FullName}
> fmt=#title:)
...
> Is there some way of doing this?
Try putting your pagelist inside another pagelist
template like this:
(:pagelist trail={$FullName} fmt=#notrail:)
[[#notrail]]
(:template first:)
(:if equal {>$Group}:)
(:pagelist group=Books link={*$FullName}
fmt=#title:)
[[#notrailend]]
If there is a trail on the current page you should get
nothing from the first pagelist. If however the trail
is blank, the template should invoke the second
pagelist.
-Martin
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
More information about the pmwiki-devel
mailing list