[Typo3] Typo3 overwrites the style attribute in <p>

Simon Tuck e-mailNO at SPAMeyejet.com
Wed Sep 28 18:52:52 CEST 2005


Meik Schmidt wrote:
> Hello!
> 
> How can i avoid that Typo3 overwrites the style attribute in the P tag?
> The problem is when i format some text with RTE the Typo3-Engine
> overwrites the style attribute.
> 
> For example:
> 
> <p style="text-align: right">..text...
> 
> becomes
> 
> <p style="margin: 0 0 0 0;">...text...
> 
> I looked in the TSRef and tried to resolve this problem with
> 
> tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines.addAttributes.P.style
> =
> 
> but it does not! In this way the whole style attribute is removed.
> 
> How can i tell the Typo3 engine that it should not make any changes on
> the style attribute in the P tag?
> 
> Thx a lot!
With addAttributes you can add (and clear) an attribute (eg. style, class etc.) to any non-Typo3 Tag (eg. P or A etc.). So 
your line of code is OK but you are telling Typo3 to clear every instance of style in a p tag. You could of course do the 
opposite:
tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines.addAttributes.P.style = text-align: right
This would add the stlye to every p tag in your bodytext. but you might not want that. So assuming you're rte configuration 
is passing the p style to the database correctly I'd say you're missing the line:
tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines.addAttributes.P.style.setOnly = blank
This will tell Typo3 to add it's own style only when there is no other style or the other style is blank.
You can check the docs here:
http://typo3.org/documentation/document-library/doc_core_tsref/encapsLines/
cheers,
Simon






More information about the TYPO3-english mailing list