Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » iframe get's closing tag stripped?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 2476 Views
  • prawnstar
    Community Member
    116 Posts

    iframe get's closing tag stripped? Link to this post

    - SS 2.4.0

    Why does SS strip out closing iframe tags?

    My page controller has a 'TextField' in the getCMSFields() function and the db array field is set as 'HTMLText.'

    Note, it's not a TinyMCE issue as others have had, it's a straight text field not an HTMLEditorField.

    When I paste iframe code into the field and hit "Save and Publish" the closing iframe tag is stripped out and a / is added to the opening iframe tag. This happens only if there is no space between the opening and closing tags. If I add a space, or presumably any character, the iframe tags are preserved as two separate tags.

    Just wondering if this is a bug or there is some reason the system would to this by default. Is < iframe /> even a legal tag?


  • SSadmin
    Community Member
    90 Posts

    Re: iframe get's closing tag stripped? Link to this post

    had the same problem.
    trying to <iframe></iframe> Google Map.
    the closing the Tag</iframe> has been trimed and to be <iframe />.

    Still deosnt works..
    Any suggestoin?!

  • Liam
    Community Member
    470 Posts

    Re: iframe get's closing tag stripped? Link to this post

    Ya I ran into this a while back. This post in my thread has more explanations.


  • neilcreagh
    Community Member
    94 Posts

    Re: iframe get's closing tag stripped? Link to this post

    I'm having this same problem, SS is automatically stripping the closing </iframe> and changing it to a self closing tag - breaking all of my page content that appears after it. Putting a space in before the closing tag works - but I don't want to have to tell my client to do this every time!

    Is there a better way or can anyone suggest a solution?

    My client wants to be able to embed multiple Vimeo videos onto the pages at various sizes - so he wants to control all the settings through Vimeo (rather than me hard coding the embed code onto the page). I've supplied a HTMLText box in Silverstripe for each Vimeo embed code, which works great except for this issue breaking the codes if a space isn't manually entered.

    I've just realised that I should maybe have put this comment on the other thread so I'll do that also.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.