[TYPO3] Preserving nested DIV tags in RTE

theboss at asleepatwork.com theboss at asleepatwork.com
Wed Jan 16 10:07:31 CET 2008


I have a problem with editing via the RTE (RTEHTMLAREA) while in the code
view, if I switch back to the non-code view (without saving) I can see the
correct view with CSS applied using the DIVs etc. If I save the content
item, the database does not end up storing any nested DIV tags, but onlythe
inner DIVs (see example below). 

I can get the raw HTML with nested DIV tags into the database by using a
content type of HTML, but I need it as a content type TEXT so my editors
can update the text content of the item without knowing HTML, but visually
"looking" pretty with CSS applied in the RTE.

Example....
I put the following block of HTML code into the RTE (source mode)::

<div class="box">
    <div class="title">What's New?</div>
    <div class="body">
        <div class="content">line 1</div>
        <div class="content">line 2</div>
    </div>
</div>

I get the following on saving it in the database and RTE::

<div class="title">What's New?</div><div class="content">line 1</div><div
class="content">line 2</div>

As you can see, all the outer div's (class 'box' and class 'body') are
gone. If I paste the desired code with nested DIV tags into the database
"tt_content" directly then load the RTE in Typo3 to edit it, the nesting is
again removed. This must be effected via the transformations to and from
the RTE/Database.

I have attempted to configure the parsers for each direction to and from
the RTE to leave the tags in tact, but I cannot seem to configure the
RTE/Parser to leave the nested DIV tags in place.

Someone has posted this same issue back in 1995 without a solution posted.
I now have the same issue with Typo 4.11. I hope someone can shed some
light on it now.

Thanks in advance.




More information about the TYPO3-english mailing list