Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to use Confluence Cloud in iFrame

Hello,

I would like to use Confluence Cloud environment in a iFrame. Is was wondering if this is possible and how it can be done?
I saw the next topic: https://confluence.atlassian.com/confkb/confluence-page-does-not-display-in-an-iframe-827335781.html
But I guess this is for the server version?

The error I get at this moment is: in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

Can someone please help me? Or is there an other way in stead of using it in an iFrame?

Thanks in advance,
Dylan

4 answers

Perhaps you should talk about why you're trying to do this, so someone here can dissuade you. Hosting a webapp in another iframe is usually a bad idea, because most developers aren't going to design their application in such a way that it would work when rendered through an iframe.

Confluence heavily uses iframes as it is too, I can't imagine there'd be any easy way to make it happen.

Perhaps I can suggest substituting the iframe for using the Confluence Cloud REST API and getting the HTML out of the JSON string of results using the expand param that's there with the page article encapsulated in HTML.

 

Hello Steve,

Thanks for your quick answer. The reason I would like to do this is because we are having an application and we would like to have an integrated online community for all the users of the application. So that when they are in a process of our application, they can ask a question directly on that moment.

Is this enough info ?

Regards

Dylan 

I haven't attempted anything related with 'putting Confluence inside an iframe' since Confluence 3.x. I can't imagine it's become easier in the meantime. However it might be possible, I do not think that putting webapps inside other webapps via iFrame is a very good solution.

Confluence doesn't offer external 'gadgets' for you to use unfortunately.

I would strongly consider using the REST API to perform typical requests to get, create, update, and delete Questions content. You could probably quickly proof-of-concept it with a simple <form> set to POST. For instance, a little 'feed' gadget and a submission box could be constructed with a few lines of HTML and some JAVASCRIPT.

I have the same situation  as Dylan where we would like to display confluence pages via iframe to another site since the data in confluence pages are wiki.  Rest api would be good for pulling data from JIRA type scenario.  Anyone figure out how to do this?

We've used Confluence Cloud's rest API instead of using an iFrame and it works fine for this as it contains HTML within the JSON results.

Here is an example Get webhook string you can use to Get some Confluence space pages using the title to retrieve specific ones. This particular string is being fetched by my Landbot chatbot which has a webhook feature:- 

https://yourcompany.atlassian.net/wiki/rest/api/content/search?cql=type=page+and+space+in+(PKB)+and+title+~@{textintitle}

Where PKB is the Confluence Space name and the @{textintitle} is a custom Landbot Chatbot variable I am passing to Confluence's REST API (with a ~ to search wild, so a keyword anywhere within the pages' titles) . JSON is returned by the Webhook which you can pretty easily JSON.parse to get the elements you want out of the JSON string  You need the + signs in the Get Address to replace spaces to work properly with Confluence Cloud REST API.  This is how I have built the Webdadi Chabot using Landbot with Webhooks to Confluence Cloud REST API.

Don't forget that the variable you're passing in as the keywords to search for needs to be in the format with quotes - so "keywordB+keywordB"

You can substitute 'title' for 'text' to search the page content and then you can also get more structured data out of Confluence's API by adding the 'expand' param, where Confluence gives you more expanded data even HTML in some parts of the JSON.

e.g.

https://youcompany.atlassian.net/wiki/rest/api/content/search?cql=title~%22@{textintitle}%22&expand=body.title&start=5&limit=25

or an Example to get the Confluence Cloud JSON results with HTML in the JSON String. 

https://yourcompany.atlassian.net/wiki/rest/api/content/" + id + "?expand=body.export_view,history.lastUpdated

Hope that helps, at least generating some useful JSON results.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

🥓🙅🏻‍♀️ Meet-less May Badge!

Hello Confluence Community!  What if i told you that you could have a healthier life and be 100% meet-less? This month, we're promoting a healthy, balanced work diet with Confluence. We la...

195 views 2 13
Read article

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