TinyMCE is messing up my formatting..

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
moncho007
New Member
New Member
Posts: 8
Joined: Thu Feb 26, 2009 7:03 pm

TinyMCE is messing up my formatting..

Post by moncho007 »

Hi,

I'm experiencing this issue - I'm using CMSMS on my site, where the pages mostly consist of source code, which is highlighted with GeSHi (thanks to streever and calguy1000 about that) :)

Anyway, when I need to insert code in the page I do it as follows - click on the checkbox Turn WISIWYG on/off at the bottom of TinyMCE and for example put this code there:

Code: Select all

{geshi lang="php"} {literal}
if ($test) {
    echo 1; 
}{/literal} {/geshi}
Then after submitting the page everything is showing up correctly, but when I go to the WISIWYG editor the code is being formatted as follows:

Code: Select all

{geshi lang="php"} {literal} if ($test) { echo 1; }{/literal} {/geshi} 
And at the end the page does not show the code correctly. This is very annoying when you have to edit an existing page and you have let's say more than 100 lines of code which formatting is messed up :(

Is there any way to fix this? Perhaps using a different editor?

Thanks!
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: TinyMCE is messing up my formatting..

Post by RonnyK »

For logic is it better to call it using GCBs where wysiwyg is disabled... For disbling wysiwyyg for GCB you could set the option in UserPreferences or GlobalSetting. Then put the logic in the GCB, and call the GCB in the page.

Ronny
moncho007
New Member
New Member
Posts: 8
Joined: Thu Feb 26, 2009 7:03 pm

Re: TinyMCE is messing up my formatting..

Post by moncho007 »

Thanks for your reply!

I'm do not completely understand how to accomplish this?

Can you please, explain a little bit more how to do this?

Greetings!
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: TinyMCE is messing up my formatting..

Post by RonnyK »

When a wysiwyg is involved, it tries to act on the given data....

So best is to put logic in blocks without a wysiwyg. This can be done by putting this data in a Global Content Block, which can be set to have no wysiwyg at all...

Either per user, in UserPreferences, or in general, in GlobalSettings, you can disable the wysiwyg for GCBs.

Than you can put what you want in the GCB, and it wont be rewritten by the wysiwyg...

Then call the GCB in the page, where you had the text before.

Ronny
moncho007
New Member
New Member
Posts: 8
Joined: Thu Feb 26, 2009 7:03 pm

Re: TinyMCE is messing up my formatting..

Post by moncho007 »

Ok, I've disabled the WYSIWYG editors on global content blocks from the Global Settings.

Please, excuse me if my questions sounds stupid to you, but If I understand you correctly I should create a GCB and then call that block from within the page like this {global_content name='geshi_code'}

So I created this GCB in Content -> GCBs and named it "geshi_code"

Code: Select all

{geshi lang='php'}{literal} {/literal}{/geshi}
But how to insert the text that needs to be highlighted - perhaps put it between the {literal} tags right inside of GCB? And if it so that means that I should create a new GCB, when I new text needs to be added - for example a new source needs to be highlighted?

I feel a little confused about these GCBs..  ???

I'm missing something here, but don't know what exactly.

Thanks for your support again!
Post Reply

Return to “CMSMS Core”