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.

 

 

  1.  
  2. ######### 
  3. ### This will allow code tag inside ul & ol
  4. ## Modified from http://www.mail-archive.com/typo3-english@lists.netfielders.de/msg15208.html
  5. lib.parseFunc_RTE {
  6.   # Processing  <ol> and  <ul> blocks separately
  7.   //here you'll need to list all tags, you assume to be external blocks
  8.   externalBlocks = ol, ul
  9.   externalBlocks {
  10.  
  11.      ol.callRecursive=1
  12.      ol.stripNL=1
  13.      ol.stdWrap.parseFunc = < lib.parseFunc
  14.  
  15.      ul.stripNL=1
  16.      ul.stdWrap.parseFunc = < lib.parseFunc
  17.      ul.stdWrap.parseFunc = < lib.parseFunc
  18. }
  19. }
  20.  

 

 


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.