Created
September 23, 2020 11:29
-
-
Save Megafry/519773509ad043f5aee016dad8e27cf0 to your computer and use it in GitHub Desktop.
TypoScript to extend TYPO3 lib.parseFunc by adding the file-extention as data attribute 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.a.typolink { | |
ATagParams.stdWrap.cObject = FILES | |
ATagParams.stdWrap.cObject { | |
stdWrap.if { | |
isPositive.data = parameters:href | |
isPositive.stdWrap.replacement { | |
10 { | |
search = t3://file?uid= | |
replace = | |
} | |
} | |
} | |
files.stdWrap < lib.parseFunc.tags.a.typolink.ATagParams.stdWrap.cObject.stdWrap.if.isPositive | |
renderObj = TEXT | |
renderObj.stdWrap { | |
data = file:current:extension | |
wrap = data-ext="|" | |
} | |
} | |
} | |
} | |
lib.parseFunc_RTE.tags.a.typolink.ATagParams.stdWrap.cObject < lib.parseFunc.tags.a.typolink.ATagParams.stdWrap.cObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original code from @gabrielRamaker gist