Page 1 of 1

help cmsms changes my code

Posted: Thu Jan 03, 2013 8:20 pm
by SolsWebdesign
Hi everyone,
I have looked everywhere but I can't seem to find the solution so I'll post my problem. Usually I use the following to stop Smarty from parsing my code:
{literal}
...
{/literal}
But does not seem to work in this case. I have a page containing the following code:

Code: Select all

{literal}
<p align="center">
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="958" height="650" id="animatie1" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="animatie1.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="animatie1.swf" quality="high" bgcolor="#ffffff" width="958" height="650" name="animatie1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
  </object>
</p>
{/literal}
As you can see a (flash) animation is included in the page. When I save this it works fine. However if I open the page again, cmsms suddenly shows the following:

Code: Select all

{literal}
<p align="center"><object id="animatie1" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="958" height="650" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="animatie1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /></object></p>
{/literal}
Note that the "embed src" tag has gone missing. When saving again my (flash) animation will stop working. Now I know not to touch that page again but unfortunately my client will surely forget!
What am I missing here? Shouldn't CMSms leave my stuff withing the {literal} tags untouched?
I don't really want to use the (marked as stale) swfobject because my code works just fine without it. That is if CMSmadeSimple doesn't change my code within literals.... Anybody any idea how to keep CMSms from changing my code?
;D

Re: help cmsms changes my code

Posted: Thu Jan 03, 2013 8:26 pm
by Rolf
Where is this code? Page, template...?

Re: help cmsms changes my code - solved I think

Posted: Thu Jan 03, 2013 8:47 pm
by SolsWebdesign
Hi Rolf,

Hmmm that is a good idea... if only I could put it in a template... It is actually in a page right now... I tried putting it in a UDT but that was stupid (incorrect code error - not surprisingly).

Thank you for making me think! I put it in an html block, it is save there from my client! It also has a note: don't change and don't save!
;)
the test page:
http://www.solswebdesign.nl/cmsmadesimp ... a-animatie

Re: help cmsms changes my code

Posted: Thu Jan 03, 2013 9:18 pm
by Wishbone
It's the WYSIWYG editor that's modifying the code. If you don't need WYSIWYG for this page, go to the Options tab and disable WYSIWYG.

Re: help cmsms changes my code

Posted: Thu Jan 10, 2013 10:24 pm
by eden
Ok, so what if you need wysiwyg?
A new stab at making a minimum footprint wysiwyg editor out of the tinymce core. Including no (non-essential) plugins and only behaving "well" and simple.
Seems like she can be a naughty girl if provoked :) Here's my case:

Code: Select all

<img src="myimage.jpg" width="200" style='{rotate amount='20'}' />
after saving it works fine until you come back only to find:

Code: Select all

<img src="myurl" width="200" />
So the whole style tag has been edited away :( Sure JQuery could do that in runtime but this would be so much simpler. Is there a way to turn off error correction from microtiny?

Edit: after posting I noticed that removing nested 'single quotes?' solved my problem.

Now I still think that really really well behaved editor would just ignore everything between and around {} tags no matter where those might be... For a really ridiculous example:

Code: Select all

<{RandomTag} {RandomStyle}='{RandomValue}'>{RandomThing}</{GetRandomTag}>
would be interesting :)

Re: help cmsms changes my code

Posted: Thu Jan 31, 2013 6:11 pm
by Dr.CSS
If you are trying to put things in the Content: box of a page and use a wysiwyg you are better off using a global content block where you can turn the wysiwyg off then you can add the GCB to the Content:...