How can I add hideelements in decorator?

Can you please give an example? 

1 answer

Hi Tolga,

The issue here is that the method renderConfluenceMacro is only working with old Wiki Markup macros or user macros. So this won't work with the HideElements macro. But you can achieve what you want with this workaround

You create a page with a HideElements macro like you want it on all pages. Then you go to "Tools > View storage format" and copy the related <ac:structured-macro...>...</ac:structured-macro>. You can remove a few things and create code like this in your user macro:

&lt;ac:structured-macro ac:name="hideelements-macro"&gt;
 &lt;ac:parameter ac:name="title"&gt;true&lt;/ac:parameter&gt;
 &lt;ac:parameter ac:name="space-logo"&gt;true&lt;/ac:parameter&gt;
&lt;/ac:structured-macro&gt;


Then you render your user macro in your decorator like this:

$helper.renderConfluenceMacro("{your-user-macro-name}")


I know this is not the cleanest way, but it's the only thing that I think works without further development. Let me know if you need further help on this!

Regards, Felix

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Asked May 24, 2018 in Confluence

What are the resources that you use to learn more about Atlassian Products?

I am gathering information about resources available for Atlassian product knowledge transferring for a presentation in our local Atlassian User Group. I want to group them in four categories From ...

604 views 18 16
View question

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