[Koha] Help needed in Template
Chris Cormack
chris at bigballofwax.co.nz
Sun Aug 8 22:20:39 NZST 2010
2010/8/8 Nitesh Rijal <rijal.it at gmail.com>:
> Dear all..
> I have a problem while making conditional display in template.
> I have a variable called fulltext. When I write <!-- TMPL_VAR
> NAME="fulltext" -->, it gets displayed in the output. Its value is either
> TRUE or FALSE.
> Now what I want to do is, show or hide a block of code on the basis of this
> variable. If it is TRUE then show a link and if it is FALSE then hide a
> link.
> How am I supposed to do this??
> What should the <!-- TMPL_IF --> block and <!-- TMPL_ELSE --> block look
> like???
> Please Help.
Hi Nitesh
What you need to do is not set an actual value if it is false.
So it should contain a value if true, and be undefined if false.
Then you can simply do
<!-- TMPL_IF NAME="fulltext"-->
block of code
<!-- /TMPL_IF -->
This type of question is much better suited to the development list,
which I have cc'd please reply to there only (I have left the other
list in case you aren't subscribed)
Chris
More information about the Koha
mailing list