TinyMCE clears all microdata when WYSIWYG is on

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.
Locked
User avatar
Erhaoen
Forum Members
Forum Members
Posts: 19
Joined: Tue Oct 19, 2010 5:32 pm

TinyMCE clears all microdata when WYSIWYG is on

Post by Erhaoen »

I was asked to enhance huge cmsms site with schema.org microdata. It was easy for all modules, because these tags are safe in templates. Problem starts when I need to add it to regular pages or global html blocks - when user switches to WYSIWYG, TinyMCE removes all non-standard attributes. I think I'm stuck, I can't force editors to use raw html code, I can't make hundreds of udt or html blocks also. Is there any solution I'm missing?
Any ideas would be appreciated.
User avatar
opawaldburger
Forum Members
Forum Members
Posts: 94
Joined: Tue Nov 04, 2008 2:10 pm

Re: TinyMCE clears all microdata when WYSIWYG is on

Post by opawaldburger »

I can't give you a full instruction, since I don't really get how to do it. BUT there is a way to tell TinyMCE which elements are valid, and which aren't.

Look here: http://tinymce.moxiecode.com/wiki.php/C ... d_elements

Greetings,
Opa
User avatar
DADOCTOR
Forum Members
Forum Members
Posts: 51
Joined: Sat Apr 02, 2011 5:39 am
Location: Australia

Re: TinyMCE clears all microdata when WYSIWYG is on

Post by DADOCTOR »

Try this

{literal} code {/literal}

I think this will work
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: TinyMCE clears all microdata when WYSIWYG is on

Post by Jos »

{literal} tags won't work, they are for smarty purposes.

Maybe you can use a second content block in your page template?

Code: Select all

{content block="microdata" wysiwyg='false'}
User avatar
kidcardboard
Forum Members
Forum Members
Posts: 54
Joined: Mon Sep 28, 2009 5:25 pm

Re: TinyMCE clears all microdata when WYSIWYG is on

Post by kidcardboard »

If I'm not mistaken using "valid_elements" will kill all the default values and you'll have to redeclare everything. I think you want to use "extended_valid_elements" instead.

Under Extensions->TinyMCE WYSIWYG->Advanced there is a section called "Extra configuration".

add the following

Code: Select all

extended_valid_elements : "element[width|height|itemscope|itemtype|itemprop]"
Now you obviously replace "element" with whatever element you want to extend, and put a pipe (|) delimited list of whatever extra parameters/microdata you want to TinyMCE to keeps it's hands off of between the [ and ].

Unfortunately you'll have to list all the valid parameters for the element as it seems to replace the valid params instead of extend them. A full list of elements and their params can be found http://www.tinymce.com/wiki.php/Configu ... d_elements
Locked

Return to “CMSMS Core”