/ Published in: TYPO3
If you want to code your own custom tag extension and package it as an TYPO3 plugin, there could be some issues getting things to work in RTE enabled textarea fields. The Extension Kickstarter only supports to add the necessary TypoScript setup for the tt_content.bodytext field but no configuration for proper redisplaying of the tag in RTEs is made.
With this setup (PageTS-Config and TypoScript Setup) you will be able to redisplay the tag in the RTE and also render it nicely with your plugin code.
Just create an extension with the Kickstarter, insert YOURTAGtag as extension key and replace YOURTAG with the tag name you like (also in the extension key).
Note: the PageTS-Config is non-destructive concerning already existing configurations, just insert it after your (propably customized) RTE configuration in the TSConfig field on your rootpage. Only settings I've found out to be necessary were added. Leave me a comment if something is redundant or unnecessary. Thanks!
With this setup (PageTS-Config and TypoScript Setup) you will be able to redisplay the tag in the RTE and also render it nicely with your plugin code.
Just create an extension with the Kickstarter, insert YOURTAGtag as extension key and replace YOURTAG with the tag name you like (also in the extension key).
Note: the PageTS-Config is non-destructive concerning already existing configurations, just insert it after your (propably customized) RTE configuration in the TSConfig field on your rootpage. Only settings I've found out to be necessary were added. Leave me a comment if something is redundant or unnecessary. Thanks!
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# the following Page-TSConfig should be added: # RTE button settings: allow User plugin RTE.default.showButtons := addToList(user) RTE.default.hideButtons := removeFromList(user) # allowed/denied tags RTE.default.proc.allowTags := addToList(YOURTAG) RTE.default.proc.denyTags := removeFromList(YOURTAG) # HTMLparser_rte settings RTE.default.proc.HTMLparser_rte = 1 # don't mask special html characters like < or > RTE.default.proc.HTMLparser_rte.htmlSpecialChars = 0 # protect specific, user defined tags # entryHTMLparser_db settings # special html characters like < or > will be stored unmasked (get masked by re-display in RTE) RTE.default.proc.entryHTMLparser_db.htmlSpecialChars = -1 # protect specific tag # protect non matching tags RTE.default.proc.entryHTMLparser_db.keepNonMatchedTags = protect # exitHTMLparser_db settings RTE.default.proc.exitHTMLparser_db = 1 # protected non matched tags during fetching from database RTE.default.proc.exitHTMLparser_db.keepNonMatchedTags = 1 # don't mask html characters like < or > RTE.default.proc.exitHTMLparser_db.htmlSpecialChars = 0 # RTE plugin "user" settings # define group name RTE.default.userElements.10 = My Own Tags # tag configuration RTE.default.userElements.10.1 = My First Tag RTE.default.userElements.10.1.description = The selected field gets wrapped with <YOURTAG>|</YOURTAG> RTE.default.userElements.10.1.mode = wrap RTE.default.userElements.10.1.content = <YOURTAG>|</YOURTAG> # furthermore, we also need the following declaration in lib.parseFunc* objects in a template records setup field: # common parsed elements (e.g.header fields) # add custom tag to parse function of the RTE lib.parseFunc_RTE.allowTags := addToList(YOURTAG) # this line enables the "passthrough" of non-typo-tags to the HTML parser # you can also specify an cObject directly, without the need of a plugin call