[solved] multiple content blocks
Posted: Tue Mar 11, 2008 2:41 pm
Hi,
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:
aber leider geht das nicht. Erstens: Ich weiß nicht wie ich bei der If anweisung den content block="imagetext" selektieren kann und zweitens weiß ich nicht wie ich es ausdrück kann "wenn imagetext größe als 0 dann soll...".
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:
dabei steht in der hilfe vom content tag zum assign attribut folgendes:
aber das geht auch nicht. ich werd bekloppt!
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}