[ic] if page

Dan Browning interchange-users@interchange.redhat.com
Thu Apr 18 19:12:01 2002


At 10:39 PM 4/18/2002 +0100, you wrote:
> >
> > I need to show some info in my LEFTRIGHT_TOP template based on what 
> page the
> > user is looking at.. is this possible?
> >
> > I tried something like [if page blahblah]...  I'm thinking I can possibly
> > declare a value based on the page name then say [if value whatever].. etc.
> >
> > Anyone done this that can help? I don't see anything in the archives or
> > resource site.
> >
>How about this:
>
>     [if term="@@MV_PAGE@@" op="eq" compare="index"]
>         We are on the index page.
>     [/if]
>
>Or this:
>
>     [if term="@@MV_PAGE@@" op="=~" compare="/^(index|results)$/"]
>         On the index or the results page.
>     [/if]
>
>Or even this:
>
>     [if global MV_PAGE =~ /^(index|results)$/]
>         On the index or the results page.
>     [/if]
>
>As ever, there is more than one way to do it.
>
>--
>    _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
>   _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
>  _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
>_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

In the spirit of TIMTOWTDI, and taking a hint from [tmp page_title], you can:

<!-- in the file itself, not the template -->
[tmp do_in_template]
         Stuff
[/tmp]

<!-- in the template -->
[scratch do_in_template]

I like it because it keeps page-specific information within the page itself.

HTH,

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The hearing ear is always found close to the speaking tongue, a custom
whereof the memory of man runneth not howsomever to the contrary,
nohow.