开发者

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">###开发者_JS百科ITEM_IMAGE###</div>
   </div>
 <?php else: ?>
   NO IMAGE
 <?php endif;?>


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:

  • http://flow3.typo3.org/documentation/manuals/fluid/
  • http://typo3.org/extensions/repository/view/smarty/current/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜