[TYPO3-german] Viewhelper Ausgabe Verschatelung

derSven kreativ at dersven.de
Mon Jul 7 14:11:20 CEST 2014


Ich habe bei einem Projekt die Anforderung das es die option auf bis zu 
5 bildern geben soll. die bilder je nachdem wie viel es sind anders 
angezeigt werden.

mit hilfe eines wrapper-divs soll das theoretisch klappen.

nur folgendes template gibt mir alle aus.. und berücksichtigt nicht das 
eine oder das andere.

was mache ich falsch?!


schemata:

if:erstes bild
if index größer als 0 dann
if total 5 dann wrap mit class="five"
if total 4 dann wrap mit class="three"
if total 3 dann wrap mit class="two"

ist diese logik falsch?!




<div id="first_segment-wrapper">
		<f:for each="{project.images}" as="image" iteration="imgIterator">
			<f:if condition="{imgIterator.isFirst}">
					<figure><f:image src="{image.uid}" 
alt="{image.originalResorce.alternative}" width="750c" height="500c-90" 
treatIdAsReference="1"/><</figure>
			</f:if>
		</f:for>

	</div>
	<div id="more_segment-wrapper">

		<f:for each="{project.images}" as="image" iteration="imgIterator">
			<!-- ab dem zweitem Bild -->
		<f:if condition="{imgIterator.index} > 0">

			<!-- wenn es insgesamt 3 gibt dann -->
			<f:if condition="{imgIterator.total} = 3">

				<div class="image-wrapper three">
					<figure><f:image src="{image.uid}" 
alt="{image.originalResorce.alternative}" width="395c" height="" 
treatIdAsReference="1"/></figure>
				</div>

			</f:if>


			<!-- wenn es insgesamt 2 gibt dann -->

			<f:if condition="{imgIterator.total} = 2">

				<div class="image-wrapper two">
					<figure><f:image src="{image.uid}" 
alt="{image.originalResorce.alternative}" width="395c" height="" 
treatIdAsReference="1"/></figure>
				</div>

			</f:if>

		</f:if>
		</f:for>

	</div>



More information about the TYPO3-german mailing list