TYPO3 RTE Tip: Putting code tags inside ul, li, or ol tags



 

If you've ever wanted to put <code> tags inside an ordered or unordered list, then this can help you out.

Sometimes I write tutorials about computer stuff. And sometimes I write lists in those tutorials. 

The problem I was having with TYPO3 when doing this was that whenever I put a <code> tag inside of an ordered or unordered list, the <code> tag wasn't properly translated on the frontend of the web site. The < and > brackets around the 'code' tag were run through htmlspecialcharacters and were showing up on the front end.

Luckily and after searching, I found a solution that allows me to put code tags in lists.

All I did was add the following to the typoscript template of my web site.

######### 

### This will allow code tag inside ul & ol

## Modified from www.mail-archive.com/typo3-english@lists.netfielders.de/msg15208.html

lib.parseFunc_RTE {

    # Processing  <ol> and  <ul> blocks separately

    //here you'll need to list all tags, you assume to be external blocks

    externalBlocks = ol, ul

    externalBlocks {

 

        ol.callRecursive=1

        ol.stripNL=1

        ol.stdWrap.parseFunc = < lib.parseFunc

 

        ul.stripNL=1

        ul.stdWrap.parseFunc = < lib.parseFunc

        ul.stdWrap.parseFunc = < lib.parseFunc

}

}

 

 


No comments

Add comment

* - required field

*

CAPTCHA image for SPAM prevention
If you can't read the word, click here.
*
*
 

Netdip.com is an excellent web site that's powered by TYPO3 and other great open source software. Netdip.com is also a fat free alternative to ice cream.