Using iframe in an user-macro

I would like to use an iframe to have an alternative pdf preview:

- If I hardcode the src the pdf opens in the iframe.

<iframe src="${config.getDomainName()}/download/attachments/${content.getIdAsString()}/${paramPDFattachmentName}" > alternative text </iframe>

- If I use the variable construction as shown above I get a dialog box to select between "save" and "open with" for the pdf in Firefox. The pdf is opened externally in the reader. If I use Chrome the pdf file is downloaded.

Is there any way to make it open in the iframe?

The Adaptavist inline macro has the same behavior but you have to use the complete url. The html macro works, but the syntax is more complex for "normal" users and you also need the complete url.

3 answers

1 accepted

This widget could not be displayed.

Hi Wayne,

this doesn't help either.

I use variables to feed the src-argument. If I use a fixed source url it already worked in the pass. There is also another problem if you have whitespaces or e.g. brackets in the filename and you pass the filename through a parameter. I had a testfile that has both of this characters and it failed before the open file dialog opened for displaying the pdf in an external viewer.

Regards

Martin Kellner

An addition: The PDF preview is in confluence 5.5 much better than it used to be in 5.1. So I stopped working on this topic after updating our system.

Hi,

can't contact you directly. Could you show example how to use variables to feed src argument?

 

The example is in my original question ... you can see it as the first message on this page. But it didn't work.

Thanks Martin,

I'm trying to build blueprint template that could be use for release notes for multiple teams to help with reports creation ... it does not goes as smoothly as I'd like to wink

This widget could not be displayed.

Hi,

The Link Preview (https://marketplace.atlassian.com/plugins/com.xpandit.plugins.linkpreview-confluence) is a great Confluence Utility. You can preview PDF documents, images and webpages.

Try it now.

Best Regards,

PMRodrigues

This widget could not be displayed.
Wayne Wong Atlassian Team Jun 16, 2014

Hi Martin,

You can refer to this document here for your iframe configuration:
https://confluence.atlassian.com/display/CONFKB/How+to+put+an+Iframe+into+Confluence.

But I not yet tried out on user macro, maybe you can test it out and let's us know about the result :)

Good luck!

Regards,


Wayne Wong

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Tuesday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

137 views 12 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you