bh_touch
Mediathek-Element für die Touch-Erweiterung
HTML-Template: el-mediathek.html
HTML
{namespace bh=TYPO3\Bh\ViewHelpers}
<bh:tmpl.element object="{cObj}">
<bh:tmpl.content section="el-mediathek" parent="{cObj.uid}" />
</bh:tmpl.element>
HTML-Template (Children): el-mediathek-item.html
HTML
{namespace bh=TYPO3\Bh\ViewHelpers}
<bh:tmpl.element object="{cObj}">
<f:for each="{cObj.allSettings.videos}" as="videos" iteration="iteration">
<bh:repository.load repository="TYPO3\Bh\Domain\Repository\FileRepository" method="findByUid" options="{videos}"
as="file">
<f:variable name="video" value="/{file.relativeFile}" />
</bh:repository.load>
</f:for>
<div class="el-mediathek-item-inner" data-video="{video}">
<bh:property.backgroundImage picture="{cObj.thing.picture}" property="picture">
</bh:property.backgroundImage>
<div class="el-mediathek-item-text">
<bh:property.text tag="div" property="text" />
</div>
</div>
</bh:tmpl.element>
Typoscript: el-mediathek.typoscript
TYPOSCRIPT
## el-mediathek
plugin.tx_bh.settings.contentElements{
el-mediathek < abstract.bhElement
el-mediathek {
name = Mediathek
description = Eine Mediathek für Touchdevices
templateFile = el-mediathek.html
templatePath = EXT:bh_touch/Resources/Public/Elements/el-mediathek/
iconFile = EXT:bh/Resources/Public/Icons/Elemente/youtube.svg
bheListgroup = 90
options{
translate = 0
edit = 0
newElement = el-mediathek-item
}
}
}
## el-mediathek-item
plugin.tx_bh.settings.contentElements{
el-mediathek-item < abstract.bhElement
el-mediathek-item {
name = Mediathek Video
description = Eine Mediathek Video für Touchdevices
templateFile = el-mediathek-item.html
templatePath = EXT:bh_touch/Resources/Public/Elements/el-mediathek/
iconFile = EXT:bh/Resources/Public/Icons/Elemente/youtube.svg
settingsForm = EXT:bh_touch/Resources/Public/Elements/el-mediathek/el-mediathek-item-settings.html
bheListgroup = 90
options{
translate = 0
edit = 1
}
dummyData.text = Videotitel
}
}
page.includeCSS{
el-mediathek = EXT:bh_touch/Resources/Public/Elements/el-mediathek/el-mediathek.css
}
page.includeJS.el-mediathek = EXT:bh_touch/Resources/Public/Elements/el-mediathek/el-mediathek.js
Settings-HTML (Children): el-mediathek-item-settings.html
HTML
{namespace bh=TYPO3\Bh\ViewHelpers}
<bh:form.settingsform content="{cObj}">
<!-- Mini MediaCake -->
<div class="bhe-formsettings-option bhe-form-field-type-mediacake">
<label><b>VIDEO</b>(.mp4)</label>
<f:if condition="{cObj.allSettings.videos}">
<f:then>
<bh:repository.load repository="TYPO3\Bh\Domain\Repository\FileRepository" method="findByUids"
options="{cObj.allSettings.videos}" as="videos">
<bh:form.mediacake name="videos" value="{videos}" />
</bh:repository.load>
</f:then>
<f:else>
<bh:form.mediacake name="videos" value="{videos}" />
</f:else>
</f:if>
</div>
<f:if condition="{cObj.allSettings.styleOptions.classes}">
<div class="bhe-formsettings-option">
<label>Styles</label>
<f:form.select multiple="true" name="style[options]" value="{cObj.allSettings.style.options}"
options="{cObj.allSettings.styleOptions.classes}" />
</div>
</f:if>
<f:form.submit value="Speichern" />
</bh:form.settingsform>