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

Adding a macro to all pages in a space

AccountName:NBzD Sep 12, 2017

Is there a way to add a macro to all pages of a space?

I have a user macro that creates some specific actionable icons. I want to include this macro on every page within a space.

How can this be done?

2 answers

1 accepted

2 votes
Answer accepted
AccountName:NBzD Sep 15, 2017 • edited

and....found it

Prereq:

The space should have the Gloabl Look and Feel theme enabled or the process wouldn't work. 

Process:

  1.  Space tools > Look and Feel
  2.  Themes > Change to Global Look and Feel
  3.  Layout > Page Layout > Edit or Create Custom
  4. Find the code: (towards the top)
    • #if ($mode == "view")
      <content tag="page-metadata-banner">
      #skiplink("page-banner", $i18n.getText("assistive.skiplink.to.banner.start"), $i18n.getText("assistive.skiplink.to.banner.end"))
      #webPanelForLocation("atl.page.metadata.banner", {"action": $action})
      $helper.renderConfluenceMacro("{MacroNameNoSpace}")
      #end
      </content>
      #end
  5.  Save
  6.  Refresh space and voila!

Hope this helps anyone else looking for a similar solution. You are welcome! :)

1 vote
Shannon Spaniol Atlassian Team Sep 13, 2017

Hi there,

You can add the macro either in the Header/Footer of a space, such as under Space Tools > Look and Feel, or you can click Layout and create a special page layout.

There is more information on how to do this on this past Community post.

Let us know if you have any questions about this.

Kind Regards,
Shannon

AccountName:NBzD Sep 15, 2017 • edited

Hi,

The past community post does talk about the same issue/question I have but doesn't necessarily provide the best example on where the $helper.renderConfluenceMacro("{testmacro}") should go within the multitude of page decorators found within Page Layout for the space. Also, not certain if it needs to be enclosed within other tags e.g. <content></content> etc.

I would very highly appreciate If you/your team could provide some more guided help on this. 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

1,553 views 8 19
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