Disable HTML Stripping in Exhibit Builder

It looks like some HTML elements are being stripped from Exhibit Builder pages. I am using Omeka for a workshop in which teachers need to embed Google Maps into a page on their exhibit using the Text Only layout. Even when entering the Maps embed code in HTML editor mode, most of the code gets stripped.

I'm guessing that somewhere <iframe> tags are getting filtered by Omeka, which generally is a good idea I suppose but it would be best if there was some way to disable this, if only in Exhibit Builder.

Any quick and safe way I can hack a solution and are there any plans to change this in the future?

Thanks as always,

Erin

I'm having this problem too but thought it was to do with my theme rather than the exhibit builder (I really don't know what I'm doing when it comes to code/CSS/etc etc)

Would love to know a workaround/answer/fix for this too!

Yes, I am trying to do the same thing - maps, embeds in general...

It's most likely a problem with the TinyMCE editor stripping out the iframes.

Go to the Exhibit Builder's javascript
(plugins/ExhibitBuilder/views/admin/javascripts/exhibits.js)

and find

 tinyMCE.init 

Add
extended_valid_elements: 'iframe', to that string and save the page.

Let us know how that works.

More info on using extended_valid_elements: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/extended_valid_elements

Thanks Sheila! It worked with a little tweak to protect some other essentials that were also getting stripped:

extended_valid_elements:"iframe[class|src|border|frameborder|width|height|scrolling|marginheight|marginwidth]",

Great!

I'm teaching a class and my students are each creating exhibits. One wanted to embed a link the Google map that he designed, but the code has been stripped out when we save the HTML on the page. I tried to add the code the ebellempire suggested, adding marginwidth]", to the end but nothing seems to have changed.

Just checking, were you editing the Exhibit Builder's javascript located on the server?
(plugins/ExhibitBuilder/views/admin/javascripts/exhibits.js)

Do you know what version of Omeka you are working in?

If you are just looking to link, you can create a link to the map within exhibit text by clicking on the link button (looks like a chain link) in the text editor. If you paste http://... into a text box, it will not be transformed into an active link unless you tell it to by wrap it in the appropriate HTML tags. Or, click the HTML button which is found at the right side of the HTML editor of the exhibit page's text box, and paste the embed code there, and click Update.

We are using Omeka 1.2.1 at
http://aphdigital.org/GVH/admin/

We are able to get the link to the Google map working, but wanted to embed the map on the page so that the user doesn't leave the exhibit prematurely.

The Google linking text that we have been trying to include is:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=107942696291494013045.000494416415dd4cb3942&source=embed&ll=40.729851,-73.99448&spn=0.012295,0.023017&output=embed"></iframe>
<small>View Poetry and Greenwich Village 1950s-1960s in a larger map</small>

I did update exhibits.js on the server, both with the basic command to include iframe, and also the longer one (which is cut off on my screen). I just looked at it again, and the <iframe> code was not stripped out, but the contents of it was. So I think that I must have done something wrong in trying to supply the end of the longer statement that ebellempire suggested. I can see the box in the edit page (though not on the public view) but the map's not there. Thanks!

I know this discussion is a bit old but there doesn't seem to be an update. I can't find the tinyMCE.init line in the script (I'm using Omeka 2.01). I'd like to add iframes to exhibits.

thanks!

Erik

Are you pasting your iframe into box with the TinyMCE design view, or are you clicking on the HMTL button in the tinymce tool bar and adding it there in that edit view?

See more: http://omeka.org/codex/Using_HTML_Editor-TinyMCE

Hi Sheila,

I've done both. Pasting it in the design view just renders the code and pasting it in the HTML window strips the code.

I can do this fine on SimplePages, but I'd like to include iframes in my exhibit.

Any ideas?

Erik

In Security Settings, have you unchecked the
Enable HTML Filtering box? Should have asked this before, but thought you may have tried it already.

Hi Sheila,

I ticked the boxed but have now unticked it. It works and looks great. I feel a fool. Sorry for bothering you with this. Thanks for your patience ;-)

Erik

No worries. It happens to all of us. Glad it is all working for you the way you want it to look!

Using Omeka 2.2 I was able to use iframes successfully in Exhibit Builder pages without disabling html filtering altogether. I changed the following two settings to get it to work:

1. In Settings->Security, I added "iframe" to the list of allowed html elements

2. On the same page, I added "iframe.src" tot he list of allowed html attributes

Hope this helps!
Ned