It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User Macros - iFrame

Ian Mason Jan 27, 2015

I would like to change a custom macros for embedding iFrames to allow users to embed more than one iFrame per page. Currently users would like to embed videos via iFrame, but the iFrame only allows one embed per page or rather cuts off the second iFrame embed. 


Basic code for the user macros is as follows and we are using Confluence 5.6.6:

## Requests a url from the user to place into an <iframe>. Also asks for height and width of the frame

## @param url:title=iframe address|type=string|required=true|desc=URL of the content to be placed in the iframe
## @param height:title=Height|type=string|required=false|desc=Specify px or % (example: 200px)|default=250px
## @param width:title=Width|type=string|required=false|desc=Specify px or % (example: 400px)|default=400px

<iframe src="$paramurl" height="$paramheight" width="$paramwidth"></iframe>

3 answers

1 vote
Alex Conde Nov 13, 2015

No need for CDATA. You need to have a line break before the closing </iframe> tag. Something like:

&lt;iframe src="$paramurl" height="$paramheight" width="$paramwidth"&gt;
Janet Fisher Oct 31, 2018

You ROCK!!  

FYI, if anyone here uses Microsoft Stream to store videos, and then if you use the Share | Embed feature to get a string of HTML code to put in an HTML macro in a Confluence page, you'll see extraneous HTML code after your video unless you do as Alex says, "You need to have a line break before the closing </iframe> tag."  The Microsoft Stream string puts the </iframe> tag on the same line as the <iframe> tag.

0 votes
Alex Medved Jan 28, 2015


It seems like it is related to incorrect rendering of the user macro. 

As when I tried your user macro it does create only one iframe and it skips the footer part...

Something related: and

The above mentioned use-cases are more complex, but the point here is that user macro renderer fails on certain scenarios. I have made a comment on the issue in Confluence JIRA to use the custom renderer, but I have not tried it myself.

Anyway, if you get into trouble  you can give a try to our plugin, You can basically include any parts of the page you want or any other content (structured such as RSS, XML, JSON or unstructured, such as HTML), inside your Confluence page

Ian Mason Jan 28, 2015

Thanks Sash, Can you clarify a bit by what you mean by incorrect rendering? The code itself is written incorrectly or just not written in a way that allows for multiple iframes, ie skipping to the footer?

Alex Medved Jan 30, 2015

See the related bug CONF-25507, and also when you have your user macro rendered it brakes the footer, very similar to the usecases mentioned in the bug.

Alex Medved Jan 31, 2015

As including 2 and more iframes using an HTML macro works fine... so it is something with User macro renderer

0 votes
Ian Mason Jan 30, 2015

Adding a CData tag fixes the embed two iframes problem, but now it displays a "]]>" before each iframe? I don't seem to have any missing tags. Is this a nesting problem. Copied below is the code:


<iframe src="$paramurl" height="$paramheight" width="$paramwidth"></iframe>

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Off-topic

Disney Live Action Reboots: Are you for or against?

Happy Friday Everyone! Today marks the international release of Disney's live action version of the animated classic Aladdin. I know that this movie was met with some controversy of over cast...

138 views 19 8
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you