1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 How to embed iframe in XF?

Discussion in 'XenForo Questions and Support' started by reddy ink, Jun 5, 2016.

  1. reddy ink

    reddy ink Active Member

    I would like to embed <iframe src=

    Can it be done by default XF or can you suggest any add-on?

    Thanks a lot!
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You could edit the template directly if it's for a specific page.

    If it's for a post, you would need to create a custom bb code.
  3. ekim

    ekim Member

    Hi, so how exactly do you do this?

    I'd just clicked on Insert, then Code, and how the code is just sitting up there at the top of the post. Is there a way to do whatever it is you're referring to, and make it to where one's enabled to insert the code, where it says code, standard across the board so can be added to each post if wanted to?

    Any help would be much appreciated!

    Thank you!
  4. ekim

    ekim Member

    Hey Paul,

    I had a misunderstanding as to what iframe was exactly, but I just don't understand what the point of the 'Insert', then 'Code', adding code, and then afterwards it just showing up as straight code on the top of the post. Do you know what I mean?
  5. Mike

    Mike XenForo Developer Staff Member

    It's for displaying code (which is formatting to maintain white space and use a monospace font).
    ekim likes this.
  6. Mr Lucky

    Mr Lucky Well-Known Member

    To create the custom bcode:

    Go to Custom BB Codes in the main home menu of your Admin Control panel

    +Add new Custom BBCODE

    Fill in the fields:

    • BB Code Tag: iframe
    • Title: iframe
    • HTML replacement: <iframe src="{text}"></iframe>
    (If you want an icon in text editor toolbar see advanced options tab)

    You now just place your frame URL between the bbcode:

    [iframe] URL [/iframe]

    I would use this withe xtreme caution
    ekim likes this.
  7. ekim

    ekim Member

    Thank you very much !! (y):)
  8. Mr Lucky

    Mr Lucky Well-Known Member

    Does it work?

    BTW, when I said use with extreme caution, this is quite dangerous. Your members will be able to embed entire Porn, terrorist or other illegal sites into your forum. And there's a good chance some law enforcement agencies will hold you liable.

    And I don't want to be cited as a defense witness, as in "Your Honour, Mr Lucky said I could do this"
  9. ekim

    ekim Member

    Hi, and sorry for the late reply! To be honest, I didn't even try it cause @Mike had said "It's for displaying code (which is formatting to maintain white space and use a monospace font)", and with what you'd provided I was gonna try to, I just hadn't got around to it yet, but thankfully you'd replied with what you did which I've quoted in this post here that I'd quoted, cause I'd planned on trying it out just to see what it'd look like, but not going to now cause that definitely seems dangerous, and already worried a little as it is with my site being what it's called, so definitely not gonna do that for sure!!

    But what I was thinking though was that iFrame would give the ability to embed a YouTube video, and them not be able to click on YouTube when watching the video on my site, do you know what I mean (like if you click on the link, http://policecaughtontape.com/threa...n-camping-in-albuquerque-new-mexico.2/#post-2, and then click play on the video, you'll see YouTube in the bottom right corner)? If so, that's what I was thinking that embedding the code would do, but I guess not.....still'd like to find out how to do that though.

    Anyways, again, I apologize for the late reply (I'd actually started to, but after 198 different tabs open, guess that's the limit, my computer crashed and I'd got sidetracked), but thank you very much for taking your time to post that of which you did! :)(y)
  10. Mr Lucky

    Mr Lucky Well-Known Member

    I don't think it would make any difference to the ability to click through to Youtube

Share This Page