Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lore 2 posts 22 karma points
    Mar 14, 2014 @ 15:03
    Lore
    0

    HTML filtering in TinyMCE

    Hello Everybody,

    I am new to Umbraco CMS.

    I am trying to add an <iframe> tag in a textfield (TinyMCE) of umbraco v 4.7.0, but this gets filtered! The application runs on ASP. net 4.0 and IIS 7.

    I know there are many similar topics in this forum, but I could not manage to fix the problem by following other suggested solutions.

    Could you please explain this to me? Thank you.

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Mar 14, 2014 @ 15:08
    Peter Gregory
    1

    Hi Lore

    You need to look at the TinyMCEConfig.config in the /config folder and add it to the list of allowed elements in the

    Hope that helps.

  • Lore 2 posts 22 karma points
    Mar 14, 2014 @ 15:35
    Lore
    0

    Hi Peter,

    I went to that file and now that looks like the following:

    Still when I click on "save and publish" nothing gets displayed! I don't understand why that happens. 

    ...
    <validElements>
    <![CDATA[+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
    ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],
    -strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,
    img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel],
    -sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],
    -tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class], iframe[src|width|height|name|align],
    thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],
    -th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],
    -span[class|align],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align],-h2[id|dir|class|align],
    -h3[id|dir|class|align],-h4[id|dir|class|align],-h5[id|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],
    dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[classid|width|height|codebase|*],
    param[name|value|_value],embed[type|width|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,button,iframe[src|style]]]>
    </validElements>
    ...
  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Mar 14, 2014 @ 15:46
    Peter Gregory
    0

    Try changing it to read

    iframe[*]

    I think it might be rejecting it because you have other attributes that are not on the list of valid attributes.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 14, 2014 @ 16:01
    Jan Skovgaard
    0

    Hi Lore and welcome to our :)

    If you can't get the above suggestions from Peter to work then you can go to the /config/umbracoSettings.config folder of the website and change the line <TidyEditorContent>True</TidyEditorContent> to "False".

    That way custom HTML tags wont get stripped and in newer Umbraco releases it has been disabled by default.

    However I personally think it's beneficial to keep the setting set to true since by disabling it opens up for the content editors to add a lot of bad markup like <font> tags and other messy stuff. Therefore I only think you should try this as a last resort if adding the iframe element to the TidyConfig does not work.

    Alternatively you could also create a macro that inserts the iframe when the page is rendered.

    Just my 2 cents.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft