[pmwiki-users] Hiding the SideBar in templates

Hans design at flutesong.fsnet.co.uk
Wed Jun 29 16:09:56 CDT 2005


Wednesday, June 29, 2005, 2:55:21 PM, Patrick wrote:
> I've been thinking about extending the <!--PageLeftFmt--> (and other)
> markups to allow "switches" that would indicate if the page should
> be loaded or not.  For example, something like:

>     <!--PageLeftFmt PageExists("$Group.SideBar")-->
>       ...
>     <!--/PageLeftFmt-->

> which would define PageLeftFmt, and perform the equivalent SetTmplDisplay
> depending on the value of PageExists.  Or, rather than full PHP code,
> we could limit the test to just the existence/non-existence of pages:

>     <!--PageLeftFmt $Group.SideBar-->
>       ...
>     <!--/PageLeftFmt-->

This looks useful, but I wonder how confusing it will be, introducing
php code into the html template this way. In particular I wonder about
how it will relate to code in other places, where SetTmplDisplay for
instance may be used. Will either override the other? Which code will
have priority?

Would the latter provide successive testing of existence of pages?
Like
    <!--PageLeftFmt $Group.SideBar Main.SideBar-->

Maybe it would be better to be able to suppress a Page...Fmt section
from within the page loading syntax, like

   <!--PageLeftFmt-->
     ....
     <!--wiki:$Group.SideBar Main.SideBar PageLeftFmt:0-->
     ....
  <!--/PageLeftFmt-->

which would mean: if no page gets loaded then PageLeftFmt will be empty,
i.e. SetTmplDisplay('PageLeftFmt', 0)


Best, 
~Hans                           




More information about the pmwiki-users mailing list