Skip to content

Instantly share code, notes, and snippets.

@Megafry
Created September 23, 2020 11:29
Show Gist options
  • Save Megafry/519773509ad043f5aee016dad8e27cf0 to your computer and use it in GitHub Desktop.
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.
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
@Megafry
Copy link
Author

Megafry commented Sep 23, 2020

Original code from @gabrielRamaker gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment