[pmwiki-users] Conditional part of a skin?

Hans design5 at softflow.co.uk
Sat Mar 1 10:55:42 CST 2008

Saturday, March 1, 2008, 4:00:42 PM, David Aldred wrote:

> I'd like to create a skin in which one section appears only if there is a wiki
> page to fill it, and doesn't appear at all otherwise. 

add to your skins tmpl file something like this:

<div id='commentpage'><!--wiki:AddBox.{$Name}--></div>

Otherwise you can do it with wiki markup and no tmpl modifications:

(:if exists AddBox.{$Name}:)
(:div1 style='float:right; width:250px; background:#ddffdd; border:1px solid #66ee66;':)
(:include AddBox.{$Name}:)

The if exists conditional is only necessary because of the div box
styling: without it it would show a bit of  a box without content.
Otherwise if an included page does not exists nothing would show when
using a (:include PageName:) markup.


More information about the pmwiki-users mailing list