Created
May 10, 2016 08:00
-
-
Save gabrielRamaker/a4df92dfcbba88a771d8d4522f6c5b34 to your computer and use it in GitHub Desktop.
Typoscript to modify typo3 filelinks to add icon and filesize without userFunc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lib.parseFunc.tags.link { | |
stdWrap.wrap { | |
if { | |
value = file | |
equals.cObject = TEXT | |
equals.cObject { | |
data = parameters:allParams | |
split { | |
token = : | |
cObjNum = 1 || 2 | |
1.current = 1 | |
} | |
} | |
} | |
cObject = COA | |
cObject { | |
10 = FILES | |
10 { | |
files.stdWrap.data = parameters:allParams | |
files.stdWrap.split { | |
token.char = 32 | |
cObjNum = 1 |*| 2 |*| 2 | |
1 { | |
current = 1 | |
split { | |
token = : | |
cObjNum = 1 || 2 | |
2.current = 1 | |
} | |
} | |
} | |
renderObj = TEXT | |
renderObj.stdWrap { | |
data = file:current:extension | |
wrap = <span class="ccv-|"></span> | |
} | |
} | |
20 = TEXT | |
20.value = | | |
30 < .10 | |
30.renderObj.stdWrap { | |
data = file:current:size | |
bytes.labels = " | kB| MB| GB" | |
bytes.base = 1000 | |
wrap = <span class="filesize"> - |</span> | |
} | |
} | |
} | |
} | |
lib.parseFunc_RTE.tags.link < lib.parseFunc.tags.link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For TYPO3 8.7, 9.5, 10.4