Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Schema.org microformats and microdata


Go to End


3 Posts   7257 Views

Avatar
SilverStripeBill

Community Member, 3 Posts

10 January 2013 at 12:25pm

Edited: 11/01/2013 5:34am

I'm trying to add some microformats / microdata and Schema.org markup on one of my pages. This involves adding invalid attributes to my html elements (itemprop, itemtype and itemscope). every time I save the page with these attributes, the invalid attributes get removed from the html.

I think the WYSIWYG is doing this.

Is there a quick workaround in the TinyMCE configuration or the CMS itself that would allow these attributes, iframe elements and more to be saved to the database?

Avatar
SilverStripeBill

Community Member, 3 Posts

11 January 2013 at 5:32am

Just an update, since I found the answer:

In \framework\forms\HtmlEditorConfig.php I changed

'verify_html' => true

to

'verify_html' => false

and it no longer removes the itemprop, itemtype and itemscope attributes from my markup.

Avatar
kuguar

Community Member, 5 Posts

8 October 2015 at 1:19pm

The TinyMCE's whitelist of HTML tags - the tags that will not be stripped from the HTML source by the editor. Add code in

mysite/_config.php

HtmlEditorConfig::get('cms')->setOption(
    'extended_valid_elements',
    'img[class|src|alt|title|width|height|align|name|itemprop],' .
	'div[itemprop|itemscope|itemtype],' . 
    'span[itemprop]' .
    'meta[itemprop|content]'
);

link1
link2