Hola - your English is mucho better than my Spanish (or is it Portguese in
Brazil?)  sorry!

I assume you're looking for PHP code equivalents for this, correct?

Is there any reason you can't just put the code in your template?

<? if ($image) { ?>
  <p>
  <img src="<?=$image;?>">
  <br>
  <br>
<? } else { ?>
<?=$name;?>
<? } ?>

That would do it just as well.  Admittedly, there's more < > and ? than you
might like,
but it's as functional (if not more so) and it's one less thing for your script
to process
at the end of the day.


Marco Aurélio wrote:

> Hello!
> ...
> {IF IMAGE}
>   <p>
>   <img src="{IMAGE}">
>   <br>
>   <br>
> {ENDIF}
>
> Thus all code between the if statement will be printed if $image is set else
> nothing will be.
>
> This is very useful when you have a list of elements that someone have some
> elements and others not, eg:
>
> 1) The template without this enhancement:
>
> <p>
> <img src="{IMAGE}"><br><br>
> {NAME}<br>
> {EMAIL}
>
> Thus if the current user doesn't have a image the <p>, <img> and <br><br>
> tags will be printed in any way.
>
> 2) The template with  the enhancement:
>
> {IF IMAGE}
> <p>
> <img src="{IMAGE}">
> <br>
> <br>
> {ENDIF}
> {NAME}<br>
> {EMAIL}
>
> Thus if the current user doesn't have a image the <p>, <img> and <br><br>
> tags will not be printed in any way, maintaining the desired design. THIS IS
> GREAT !!!
>
> Note)
>
> Also, would be excellent if we have the following options on tags:
>
> 1) include a file not parsed (straight include of HTML) (allows php code)
> 2) include a file parsed (parse the include file for tags) (allows php code)
>
> Is possible to convert the Template.pm (see annexed file) by Gossamer
> to php class ???

It probably is, if anyone wants to take a stab, but we generally just use the
method
I described above.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to