[Typo3] Removing <p> tags from content

Toni Milovan tmilovan at efpu.hr
Tue Nov 1 15:49:36 CET 2005


A-san wrote:
> A-san wrote:
> 
>> I want to remove the <p> tag from news items.  I followed what was 
>> said in the documentation of tt_news however nothing changed for some 
>> reason.  Can someone explain, comprehensively, step by step what I 
>> should do (and what settings, etc) to remove these tags?
>>
>> Thanks. :)
> 
> 
> Very interesting how my threads hardly ever get answers.. :(

Try to add this to TS setup field of your template.

It should be selfexplanatory:

plugin.tt_news.general_stdWrap.parseFunc >
plugin.tt_news.general_stdWrap.parseFunc < lib.parseFunc_RTE
plugin.tt_news.general_stdWrap.parseFunc.nonTypoTagStdWrap >
tt_news.HTMLparser = 1
tt_news.HTMLparser.removeTags = font
tt_news.HTMLparser.allowTags = p,a,h1,h2,h3,h4,strong,b,i,br,span
tt_news.HTMLparser.noAttrib = p
tt_news.parseFunc.nonTypoTagStdWrap.encapsLines {
      encapsTagList = div, p
       innerStdWrap_all = P
      nonWrappedTag = P
       defaultAlign = left
        addAttributes.P.align = left
}

plugin.tt_news.displaySingle.content_stdWrap.HTMLparser < tt_news.HTMLparser
plugin.tt_news.displaySingle.content_stdWrap.parseFunc < tt_news.parseFunc

This would remove p tags arounf everything except from RTE field text lines.

If you desire to remove this too, it can easily be done by tweaking the 
code above.

Cheers,

TOni



More information about the TYPO3-english mailing list