Jacek Francuz
Jacek Francuz

Reputation: 2498

Implement an if/else using TYPO3 templates syntax

Is there a way to to implement IF/ELSE using TYPO3 templates syntax?

Here is my template:

<div class="simi-prof-pic">
  <div class="simi-botcurv">###ITEM_IMAGE###</div>
</div>

I would like it to work this way (written using PHP syntax):

 <?php if(###ITEM_IMAGE###):?>
   <div class="simi-prof-pic">
    <div class="simi-botcurv">###ITEM_IMAGE###</div>
   </div>
 <?php else: ?>
   NO IMAGE
 <?php endif;?>

Upvotes: 0

Views: 279

Answers (1)

Simon Tuck
Simon Tuck

Reputation: 63

If you're implementing an extension you downloaded you're pretty much stuck with what you get and the templating engine you're describing is a simple search and replace mechanism which cannot be extended, cannot implement much presentation logic and will not interpret PHP.

If, however, you're writing your own module you can implement any of the alternative templating engines available for TYPO3, for example:

Upvotes: 1

Related Questions