Return to Snippet

Revision: 20611
at November 29, 2009 14:47 by dreadwarrior


Updated Code
# 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
RTE.default.proc.HTMLparser_rte.tags.YOURTAG.protect = 1

# 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
RTE.default.proc.entryHTMLparser_db.tags.YOURTAG.protect = 1
# 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)
lib.parseFunc.allowTags := addToList(YOURTAG)
lib.parseFunc.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
lib.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1

# add custom tag to parse function of the RTE
lib.parseFunc_RTE.allowTags := addToList(YOURTAG)
lib.parseFunc_RTE.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
# 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
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi

Revision: 20610
at November 29, 2009 14:45 by dreadwarrior


Updated Code
# 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(star)
RTE.default.proc.denyTags := removeFromList(star)

# 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
RTE.default.proc.HTMLparser_rte.tags.YOURTAG.protect = 1

# 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
RTE.default.proc.entryHTMLparser_db.tags.YOURTAG.protect = 1
# 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)
lib.parseFunc.allowTags := addToList(YOURTAG)
lib.parseFunc.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
lib.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1

# add custom tag to parse function of the RTE
lib.parseFunc_RTE.allowTags := addToList(YOURTAG)
lib.parseFunc_RTE.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
# 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
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi

Revision: 20609
at November 20, 2009 03:22 by dreadwarrior


Updated Code
# the following Page-TSConfig should be added:

# RTE button settings: allow User plugin
RTE.default.showButtons := addToList(user)
RTE.default.hideButtons := removeFromList(user)

# 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
RTE.default.proc.HTMLparser_rte.tags.YOURTAG.protect = 1

# 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
RTE.default.proc.entryHTMLparser_db.tags.YOURTAG.protect = 1
# 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)
lib.parseFunc.allowTags := addToList(YOURTAG)
lib.parseFunc.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
lib.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1

# add custom tag to parse function of the RTE
lib.parseFunc_RTE.allowTags := addToList(YOURTAG)
lib.parseFunc_RTE.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
# 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
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi

Revision: 20608
at November 20, 2009 03:16 by dreadwarrior


Updated Code
# the following Page-TSConfig should be added:

# 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
RTE.default.proc.HTMLparser_rte.tags.YOURTAG.protect = 1

# 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
RTE.default.proc.entryHTMLparser_db.tags.YOURTAG.protect = 1
# 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)
lib.parseFunc.allowTags := addToList(YOURTAG)
lib.parseFunc.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
lib.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1

# add custom tag to parse function of the RTE
lib.parseFunc_RTE.allowTags := addToList(YOURTAG)
lib.parseFunc_RTE.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1
# 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
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi

Revision: 20607
at November 19, 2009 18:55 by dreadwarrior


Initial Code
# the following Page-TSConfig should be added:

# 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
RTE.default.proc.HTMLparser_rte.tags.YOURTAG.protect = 1

# 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
RTE.default.proc.entryHTMLparser_db.tags.YOURTAG.protect = 1
# 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)
lib.parseFunc.allowTags := addToList(YOURTAG)
lib.parseFunc.tags.star = < plugin.tx_YOURTAGtag_pi1
lib.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi1

# add custom tag to parse function of the RTE
lib.parseFunc_RTE.allowTags := addToList(YOURTAG)
lib.parseFunc_RTE.tags.star = < plugin.tx_YOURTAGtag_pi1
# 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
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.YOURTAG = < plugin.tx_YOURTAGtag_pi

Initial URL

                                

Initial Description
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!

Initial Title
TYPO3 Custom Tag Extension - necessary PageTS-Config for RTE and TypoScript Setup for lib.parseFunc*-Objects

Initial Tags

                                

Initial Language
TYPO3