Hey all!
I was wondering if it was possible to create a field on any Confluence page that acted like an embedded browser, where that field's content was dynamically loaded based on a link clicked on the Confluence page.
I know you can embed static Confluence pages into other pages, but I can't find anything on how to do it dynamically based on a link click.
Thanks!
Tim
Community moderators have prevented the ability to post new answers.
That's exactly what I want to do. I have a link on my main page, and clicking it loads the page for that link in a section on the main page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do this using AJAX. Here's a user macro that does that for a different purpose (asynchrounously executing an include of a page that takes a long time to render). You should be able to extract what you need from this.
## Macro title: Asyncronous Include ## Macro has a body: Y ## Body processing: unrendered ## Output: Selected output option ## ## Developed by: Jonathan Simonoff ## Date created: 12/30/2013 ## Installed by: Jonathan ## Renders and inserts content of named page using ajax. ## @param page:title=Included Page Name|type=confluence-content|required=true|desc=The page to be included. ## Param could contain space, or not #set($random=$content.currentDate.getTime()) #set($colonlocation=$parampage.indexOf(":")) #if($colonlocation>-1) #set($mypage=$parampage.substring($colonlocation)) #set($myspace=$parampage.substring(0,$colonlocation)) #set($mypage=$mypage.replace(":","")) #else #set($mypage=$parampage) #set($myspace=$space.getKey()) #end <div id="deferreddiv${random}" class="deferreddiv"> </div> <script> var deferrediv=document.getElementById("deferreddiv${random}") deferreddiv${random}.innerHTML="${body}" jQuery.ajax({ type: "POST", timeout: 300000, url : "/rpc/json-rpc/confluenceservice-v2/renderContent", data: ' [ "ASPACEKEY", 76281481, "{include:${myspace}:${mypage}}" ] ', contentType: "application/json; charset=utf-8", dataType: "json", success : function(result){ deferreddiv${random}.innerHTML=result.replace("<p></p>","").replace("<p></p>",""); }, failure: function(errMsg){ alert(errMsg); }, error: function(xhr, ajaxOptions, thrownError){ alert("Error. Reason: " + thrownError); } }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would like to be able to include a Confluence page in another Confluence page (same Confluence instance) dynamically. I don't think the Include Macro is going to work in this case as I don't understand how to make the page name variable.
I'm wondering if Jonathon's macro script could be Javascript only and included in a page via the HTML macro? I've tried, but no luck yet. Hoping someone will help.
I essentially want to create a slide show using the pages in the space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, you want to be able to click something, and load a different page inside a section? Can you more plainly explain the use-case?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.