[TYPO3-german] Viehelper für Ausgabe der Endung einer Datei
Philipp Holdener
philipp.holdener at me.com
Tue Nov 4 16:42:05 CET 2014
Hallo zusammen
Ich hab hier ein DCE für einen Downloadbereich.
Da gebe ich mit einem VHS Viewhelper bereits die Grösse der Datei an.
Gerne würde ich auch die Dateiendung irgendwie ausgeben lassen.
Mein fluid sieht bis jetzt so aus
<ul>
<f:for each="{field.download}" as="download">
<v:var.set name="downloadFileInMb">
<v:math.round decimals="2">
<v:math.division b="1048576">
{dce:typolinkUrl(parameter:'{download.datei}') ->
v:format.trim(characters: '/') -> v:media.size()}
</v:math.division>
</v:math.round>
</v:var.set>
<li>
<a href="{dce:typolinkUrl(parameter:'{download.datei}')}"
target="_blank" title="{download.dateiTitel}">{download.name}</a>
<div class="img-box">
<img src="/fileadmin/templates/images/{download.typ}.png" alt="#" />
<span>{downloadFileInMb -> v:format.trim()}MB</span>
</div>
</li>
</f:for>
</ul>
Der Viewhelper zur Ausgabe des Dateityps wäre wohl
Tag usage example
<v:media.extension file="NULL">
<!-- tag content - may be ignored! -->
</v:media.extension>
Inline usage example
{v:media.extension(file: 'NULL')}
Doch wie benutze ich jetzt das?
{v:media.extension(file: '{download.datei}')}
geht nicht.
<v:media.extension file="{download.datei}">
{download.datei}
</v:media.extension>
Gibt auch nichts aus.
Hat mir jemand einen Tipp?
Besten Dank
Gruss
Philipp
More information about the TYPO3-german
mailing list