[Pmwiki-users] Conditional styling when inserting a page

Patrick R. Michaud pmichaud
Sun Jan 16 17:50:27 CST 2005


On Sun, Jan 16, 2005 at 06:36:41PM +0000, Hans Bracker wrote:
> Sunday, January 16, 2005, 6:27:54 PM, Patrick wrote:
> > I'm still working on a "good" standard way to do this.  So far the best
> > I've come up with is to do something like the following in skin.php:
> 
> > if (PageExists(FmtPageName('$Group.RightBar', $pagename)) ||
> >     PageExists('Main.RightBar')) { 
> >   ....
> > }
> 
> But the page might exist and it is empty, then for instance an empty
> box will show. i got this right now without setting conditions.
> I would like an empty page not to trigger the styling.
> It is often usefull to just clear a page of content without actually
> deleting it.
> Any other way?

$rpage = ReadPage(FmtPageName('$Group.RightBar', $pagename));
if ($rpage['text'] == '') $rpage = ReadPage('Main.RightBar');
if ($rpage['text'] > '') {
  ....
}

Pm



More information about the pmwiki-users mailing list