[SOLVED] Why are my div's being stripped out in TinyMCE?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
DCX
Forum Members
Forum Members
Posts: 31
Joined: Fri Jan 09, 2009 7:35 am

[SOLVED] Why are my div's being stripped out in TinyMCE?

Post by DCX »

I am using 1.8 and am accustomed to tinymce and smarty requiring some tweaks like {literal} to use code but I am having a problem now that is new to me. I don't really know this has anything to do with tinymce, just a guess.

I am trying to add code like this into the tinymce editor. I am turning the wysiwyg off.

Code: Select all

<div class="Block">
<div class="Block-tl"></div>
<div class="Block-tr"><div></div></div>
<div class="Block-bl"><div></div></div>
<div class="Block-br"><div></div></div>
<div class="Block-tc"><div></div></div>
<div class="Block-bc"><div></div></div>
<div class="Block-cl"><div></div></div>
<div class="Block-cr"><div></div></div>
<div class="Block-cc"></div>
<div class="Block-body">
<div class="BlockHeader">
That works fine. I save the page and it works just fine. BUT if I open that page again and save it, even with NO changes, tinymce changes it to this.

Code: Select all

<div class="Block">
<div class="BlockHeader">
Why did it remove all of my div's? I tried using the literal tag but no go. Is this a setting in tinymce or something else? Above is a sample of the code which is actually much longer.
Last edited by DCX on Sun Jul 11, 2010 12:43 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Why are my div's being stripped out in TinyMCE?

Post by Dr.CSS »

That looks like code that should be put in the template not tiny, tiny may be eating them as they are empty...

If for some reason you absolutely need them in the content area you may want to try putting tem in a GCB then call it in tiny, just don't open the GCB once it's filled with this as tiny will eta it there also...
Peciura

Re: Why are my div's being stripped out in TinyMCE?

Post by Peciura »

Other solution is to put that code o UDT

Code: Select all

echo '
<div class="Block">
<div class="Block-tl"></div>
<div class="Block-tr"><div></div></div>
<div class="Block-bl"><div></div></div>
<div class="Block-br"><div></div></div>
<div class="Block-tc"><div></div></div>
<div class="Block-bc"><div></div></div>
<div class="Block-cl"><div></div></div>
<div class="Block-cr"><div></div></div>
<div class="Block-cc"></div>
<div class="Block-body">
<div class="BlockHeader">
';
and then call it wherever you want.
DCX
Forum Members
Forum Members
Posts: 31
Joined: Fri Jan 09, 2009 7:35 am

Re: Why are my div's being stripped out in TinyMCE?

Post by DCX »

Yes Dr., it is code that should be in a template, in fact that's where I clipped it from. It creates a nice little sort of table I wanted to reproduce inside some articles, hence the insertion in tinymce. Adding to a global content block is a good idea.

Peciura - As many cmsms's as I have installed, I have never used UDT's. Had to look it up. That has promise.

Thanks for the help.
Post Reply

Return to “Modules/Add-Ons”