Last active
October 8, 2020 08:51
-
-
Save pixelbrackets/865778f36d73f09adfc58a9835ca5496 to your computer and use it in GitHub Desktop.
TypoScript Template Render Fix - Hotfix if some TYPO3 plugins render unwanted HTML and you need a way to replace this without changing the plugin
This file contains hidden or 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
# page = PAGE | |
# page.10 = FLUIDTEMPLATE | |
# page.10 { | |
# # TYPO3 page template and all content rendered here, containing some unwanted markup | |
# } | |
### Template Render Fix | |
page.10 { | |
stdWrap.replacement { | |
### Replace legacy Values | |
10 { | |
search = Old Name | |
replace = New Name | |
} | |
### Force HTTP to HTTPS | |
20 { | |
search = http://example.com | |
replace = https://example.com | |
} | |
### Force CDN usage | |
30 { | |
search = "/fileadmin/ | |
replace = "https://cdn.example.com/fileadmin/ | |
} | |
} | |
} |
There is an extension to replace strings in the output document as well: https://extensions.typo3.org/extension/replacer/
Example Code: https://docs.typo3.org/p/jweiland/replacer/1.5/en-us/Configuration/Index.html#basic-search-and-replace
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypoScript Replacement supports RegEx as well: https://docs.typo3.org/m/typo3/reference-typoscript/10.4/en-us/Functions/Replacement.html