[TYPO3-english] Image in Custom Content Element

Adrian O. adrian.ohlhausen at googlemail.com
Wed Nov 8 10:21:09 CET 2017


Hello,

for my little project, I have developed an Extension, which only should have the capability of displaying 5 text fields and 1 image.

I have no problem with the text fields. In the ext_tables.sql I add 5 fields, also in the TCA. In the BE i display these fields plus the Image Upload Form with this:

$GLOBALS['TCA']['tt_content']['types']['TextOnSlide'] = array(
		'showitem' => '--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general, tx_rsc_hd1, tx_rsc_hd2, tx_rsc_sub_top, tx_rsc_sub_middle, tx_rsc_sub_bottom, assets'
);

Displaying the fields is done like this:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
	<article style="position: absolute; width: 100%; opacity: 0;">
		<div class="container">
			<div class="col6">
				<h3>{data.tx_rsc_hd1}</h3>
				<h4>{data.tx_rsc_hd2}</h4>
				<f:if condition="{data.tx_rsc_sub_top}!=''"><f:then><p class="top">{data.tx_rsc_sub_top}</p></f:then></f:if>
				<f:if condition="{data.tx_rsc_sub_middle}!=''"><f:then><p class="middle">{data.tx_rsc_sub_middle}</p></f:then></f:if>
				<f:if condition="{data.tx_rsc_sub_bottom}!=''"><f:then><p class="bottom">{data.tx_rsc_sub_bottom}</p></f:then></f:if>
			</div>
			<div class="col6">
				<f:for each="{files}" as="file">
					<f:image image="{file}" height="{data.imageheight}" width="{data.imagewidth}" alt="{file.properties.alt}" title="{file.properties.title}"/>
				</f:for>
			</div>
		</div>
	</article>
</html>


But this does not work. The image is not displayed, and there is no hint inside the source code of the html output page.

I also tried iterating through the {gallery} object ({gallery.rows}, {gallery.rows.column}, {gallery.rows.columns.media}), which did not work either.

Am I doing it wrong?

Greetings, xola

P.S.: How can I turn on Code inside this text box here in the forum? So that my code is correctly indented?


More information about the TYPO3-english mailing list