Page 1 of 1
TinyMCE clears all microdata when WYSIWYG is on
Posted: Fri Jul 29, 2011 2:47 am
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.
Re: TinyMCE clears all microdata when WYSIWYG is on
Posted: Fri Jul 29, 2011 9:00 am
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
Re: TinyMCE clears all microdata when WYSIWYG is on
Posted: Sun Jul 31, 2011 12:16 am
by DADOCTOR
Try this
{literal} code {/literal}
I think this will work
Re: TinyMCE clears all microdata when WYSIWYG is on
Posted: Mon Aug 01, 2011 8:53 am
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'}
Re: TinyMCE clears all microdata when WYSIWYG is on
Posted: Thu Aug 11, 2011 4:21 pm
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