[TYPO3-english] Learning FLUID with TYPO3 6.2.x and News (tx_news)

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Wed Dec 3 19:19:29 CET 2014


Hello!

I am trying to get into FLUID and take the extension News as a starting 
point. I am very new to this so please bear with me.

Based on the media-templates, I would like to create my custom templates 
for downloading images...

So I added this within "Detail.html"

...
<f:if condition="{news.media}">
	<div class="productafbeelding">
		<div class="afbeeldingen">
			<f:render partial="Detail/DownloadContainer" arguments="{media: 
news.media, settings:settings}" />
		</div>
	</div>
</f:if>		
...

Created a 2 partials in "news/Resources/Private/Partials/Detail/"

- DownloadContainer.html
- MediaDownload.html
(these are both copied from the MediaImage-variant


This is "DownloadContainer.html" which calls "MediaDownload.html"
<f:if condition="{media}">
	<f:for each="{media}" as="mediaElement" iteration="itemIterator">
		<f:if condition="{mediaElement.type} == 0">
			<f:if condition="{itemIterator.index} <15">
				<f:render partial="Detail/MediaDownload" arguments="{mediaElement: 
mediaElement}" />
			</f:if>
		</f:if>
	</f:for>
</f:if>

This is "MediaDownload.html"
<f:if condition="{settings.detail.media.image.lightbox}">
	<f:then>
		<a class="imgpop kolom" rel="{settings.detail.media.image.lightbox}" 
title="{mediaElement.caption}" 
href="{f:uri.image(src:'uploads/tx_news/{mediaElement.content}' 
maxWidth:'800')}">
			<div class="image-center"><f:image 
src="uploads/tx_news/{mediaElement.content}" 
title="{mediaElement.title}" alt="{mediaElement.alt}" width="370c" 
height="370c" /></div>
		</a>
	</f:then>
	<f:else>
		<f:image src="uploads/tx_news/{mediaElement.content}" 
title="{mediaElement.title}" alt="{mediaElement.alt}" maxWidth="300c" 
maxHeight="300c" />
	</f:else>
</f:if>

These 3 files work together BUT if I change fe a size-setting for images 
by hardcoding this in the partial, this also affects the other set of 
templates where I copied these from, that is "MediaContainer.html" and 
"MediaImage.html".

How does this come? Any ideas?
Thanks in advance for any suggestion!

Regards,
Bert



































More information about the TYPO3-english mailing list