[Koha] Need Help in Template code

Bernardo Gonzalez Kriegel bgkriegel at gmail.com
Mon Aug 9 10:14:51 NZST 2010


Hi,

as explained on
http://search.cpan.org/~samtregar/HTML-Template-2.9/Template.pm#TMPL_IF
you need to pass a variable whose value is true or false to PERL, for example

<!-- TMPL_IF NAME="fulltext"-->
  Show if true
<!-- TMPL_ELSE -->
  Otherwise
<!-- /TMPL_IF -->

would work if "fulltext" has values "1" (true) or "0" (false). From
the point of view of PERL, "TRUE" and "FALSE" are true.

You will need to set apropriate values, following the example
 $template->param( fulltext => '1'); # for true
 $template->param( fulltext => '0'); # for false

Hope that helps.

Bernardo

2010/8/8 Nitesh Rijal <rijal.it at gmail.com>:
> Hello all.
>
> I am trying to display a link only if one variable has TRUE. For this I have
> the following:
>
> <!-- TMPL_VAR NAME="fulltext" --> gives me either TRUE or FALSE
>
> what should the <!-- TMPL_IF --> look like, so that if it is TRUE then IF
> block is displayed otherwise ELSE block is displayed.
>
> Please Help.
>
> Regards.
>
> Nitesh Rijal
> BE IT
> rijal.it at gmail.com
> http://niteshrijal.com.np
> http://facebook.com/openrijal
> http://twitter.com/openrijal
> +9779841458173
>
> _______________________________________________
> Koha mailing list
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
>


More information about the Koha mailing list