Monday, June 9, 2008

Iframes within Sitecore - $$iframe

Since the Sitecore Content Editor can't handle the iframe tag for some reason it needs to be replaced with $$iframe and iframe$$ for the start and end html tags.

The web.config needs to have the iframe items added to do this. See below.

replacer id="publish" singleinstance="true" type="Sitecore.Text.Replacer, Sitecore.Kernel" mode="on"
param desc="name"$(id)/param
replacements hint="raw:AddReplacement"
simple ignorecase="true" replacewith="" find="/Home"
simple ignorecase="true" replacewith="/sitecore/content/home/news" find="/sitecore/content/news"
simple ignorecase="false" replacewith="<iframe" find="$$iframe" forpublish="true"/simple
simple ignorecase="false" replacewith="></iframe>" find="iframe$$" forpublish="true"/simple


Peter said...

Your code example is a mess. Almost all < and > signs have been removed...

Anonymous said...

I am having difficulty within the web.config, with placing the symbols within quotes: < and >

Anonymous said...

OK, I have tried everything, but 5.3.2 simply replaces to EMPTY:

<simple find="lEsStHaN" replacewith="&#60;" ignorecase="false" forpublish="true" />
<simple find="gReAtHeR" replacewith="&#62;" ignorecase="false" forpublish="true" />

MetrowestMiss said...

I use iframe on my site. I just add it to the HTML view in the code. Within the iframe brackets: width="485" height="800" src="" frameborder="0" target="_parent"

The red line indicating an error appears, but the page works fine. What is your experience with content editor not allowing iframe?

digital signature sharepoint said...

Wow, you are really great and deserve a round of applause for the great things you are doing !