Ich habe insgesamt drei Content blocks. Wenn einer davon nicht mit Text im Backend gefüllt wird, so soll der div drumherum auch nicht ausgegeben werden. Ich habe mir das folgendermaßen gedacht:
Code: Select all
{if $content->imagetext == true}
<div id="images">
<div>{content block="images"}</div>
<p>{content block="imagetext"}</p>
</div>
{else}
{/if}
Ich habe jetzt schon die CMSMS Doku und die Doku von Smarty selbst durchsucht um eine Lösung zu finden. Wie geht das?
Ich habe das auch mal probiert wie es hier bereits vorgeschlagen wurde aber das funzt net:
Code: Select all
{if $imagetext gt 0}
<div id="images">
<div>{content block="images"}</div>
<p>{content block="imagetext" assign="imagetext"}</p>
</div>
{else}
{/if}
zusätzlich habe ich noch durch forumsuche folgendes probiert:...which you can then use in other areas of the page, or use to test whether content exists in it or not.
Code: Select all
{if !empty($images)}
<div id="images">
<div>{content block="images" assign="images"}</div>
<p>{content block="imagetext" oneline="true"}</p>
</div>
{/if}