[solved] multiple content blocks

Für Fragen und Diskussionen zum Layout und Design, Templates und Stylesheets sowie Themes
Post Reply
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am

[solved] multiple content blocks

Post by nicmare »

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:

Code: Select all

{if $content->imagetext == true}
	  <div id="images">
		<div>{content block="images"}</div>

		<p>{content block="imagetext"}</p>
		</div>
{else}

{/if}
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:

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}
dabei steht in der hilfe vom content tag zum assign attribut folgendes:
...which you can then use in other areas of the page, or use to test whether content exists in it or not.
zusätzlich habe ich noch durch forumsuche folgendes probiert:

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}
aber das geht auch nicht. ich werd bekloppt!
Last edited by nicmare on Tue Mar 11, 2008 7:01 pm, edited 1 time in total.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am

Re: multiple content blocks

Post by nicmare »

meine güte. ich habe es hinbekommen! :D
so gehts (verdammt doch mal):

Code: Select all

{content block='images' assign='imagevar'}
{if !empty($imagevar)}
<div id="images">
		<div> {content block='images'}</div>

		<p>{content block="imagetext" oneline="true"}</p>
</div>

{/if}
Last edited by nicmare on Tue Mar 11, 2008 3:24 pm, edited 1 time in total.
Post Reply

Return to “Layout und Design”