Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

User Macro - Type - Confluence Content - Link to Page

becki.marsh August 9, 2022

Howdy, I created a user macro that can act as a navigation tile. The end user can search for a Confluence page or use a URL. 

Upon testing, a URL works, and so does a link to a page within the current space. Pages outside of the space do not seem to function.

The param:

## @param TileLink:title=Tile Link URL|type=confluence-content|desc=Link for tile|desc=Search for a Confluence page or paste the full URL path - must include http... 

 The code to utilize it:

<ac:structured-macro ac:name="html" ac:schema-version="1" >
<ac:plain-text-body>
<![CDATA[<script>  

$( "#$!paramTileID" ).click(function() {

window.open("$!paramTileLink");

});
</script>]]>

</ac:plain-text-body>
</ac:structured-macro>

 When looking at what the TileLink param contains for other spaces it shows <spacekey>:<pagename>. Any ideas how I can link to other pages outside of the current space?

Many thanks!

1 answer

1 accepted

0 votes
Answer accepted
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2022

Hello @becki.marsh , I have written a lot of user macros, but have not used that parameter type. But I did find this discussion that might help you parse out what you need.

https://community.developer.atlassian.com/t/usage-of-param-type-confluence-content-in-macro-for-pages-with-a-semicolon-in-the-title/46679 

becki.marsh August 10, 2022

Thanks Bill, I'll have a read through that later and give it a whirl. 

becki.marsh August 10, 2022

It's a shame that the confluence-content type isn't more useful - I'll switch back to using a string :) 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events