[TYPO3] How to configure RTE to remove empty tagsets?
Tyler Kraft
tyler.kraft at netefficiency.co.uk
Wed Jan 23 11:47:43 CET 2008
Hi
Thanks, that is really handy :-)
Would you submit this to typo3 bugs as a requested feature for parseFunc
- There are many other times where I have wanted this!
Tyler
Peter Klein wrote:
> Hi Tyler.
> Ok. then there's a reason why I couldn't find a TS solution :)
>
> I ended up with writing a small userFunct to remove those empty tagsets.
> Maybe it's useful for other who has the same problem?
>
>
> -- cut Typoscript SETUP - cut --
> page.includeLibs.user_parseFunc = fileadmin/scripts/parseFunc.inc
>
> lib.parseFunc.nonTypoTagUserFunc = user_parseFunc->stripEmptyTags
> lib.parseFunc.nonTypoTagUserFunc.tagList = b,strong,i
> lib.parseFunc_RTE.nonTypoTagUserFunc = user_parseFunc->stripEmptyTags
> lib.parseFunc_RTE.nonTypoTagUserFunc.tagList = b,strong,i
>
> -- cut Typoscript SETUP - cut --
>
>
> -- cut - File: fileadmin/scripts/parseFunc.inc - cut --
> <?php
> class user_parseFunc {
> function stripEmptyTags($content,$conf) {
> $tags = explode(',',$conf['tagList']);
> foreach ($tags as $k => $tag) {
> $content = preg_replace('%<'.$tag.'></'.$tag.'>%si', '['.$tag.']',
> $content);
> }
> return $content;
> }
> }
> ?>
> -- cut - File: fileadmin/scripts/parseFunc.inc - cut --
>
> The parameter "tagList" defines which tags should get processed.
>
More information about the TYPO3-english
mailing list