6 Useful Macros to Maintain Common Content Efficiently


Haven’t you run into situations where you needed to copy and paste certain common content (e.g., certain configurations) when working with documentation in Confluence? 
Well, copying and pasting content is easy, but the downside of it sets in only when it comes to updating this content. 

The Atlassian Marketplace offers the following macros, which are supported by Confluence, to help maintain common content in a more efficient manner.
  • Excerpt Macro
  • Excerpt Include Macro
  • Multiexcerpt Macro
  • Multiexcerpt Include Macro
  • Include Page Macro
  • No Include Macro
You can add an Excerpt macro to a page and include the content that you want to reuse within it. Thereafter, you can add the Excerpt Include Macro in the other page in which you want to duplicate the content, and specify the name of the page that the excerpt you added was in, in order to pull the content to the second page. 

You can use the Multiexcerpt macro and Multiexcerpt include macro in the same way in which you used the Excerpt and Excerpt Include macros. However, when working with Multiexcerpts you need to specify the MultiExcerpt Name in order to define as to which Multiexcerpt macro you wish to work with.

You can also use the Include Page macro when you want to duplicate the content that is available in another page, which can be a page either in another Confluence space or within the same Confluence space. This is particularly handy if there is common content in a page that needs to be shown in two separate product related Confluence spaces. 

You can add content within a No Content macro when you want to prevent certain content from being pulled/duplicated when using the Excerpt Include macro, Multiexcerpt Include macro, or the Include Page macro. You need to add the No Content macro within the page itself or within the Multiexcerpt or Excerpt macro that is in the page.

Did you know?

  • The Excerpt Include macro will always show you the content of the very first excerpt in a page. Therefore, it is not logical to add more than one Excerpt macro in a page.
  • The Excerpt Include macro will not work if you are trying to pull content from an Excerpt macro that is defined within the same page.
  • Even if the content of an Excerpt macro is hidden in a page (e.g., page “X”), that hidden content will appear in another page (e.g., page “Y”) if you accidentally add an Excerpt Include macro to pull content from the previously mentioned page (e.g. page “X”). The same is true when working with the Multiexcerpt and Multiexcerpt Include macros.
  • You can add more than one Multiexcerpt macro within a single page.
  • You can even reuse content within a page by using the Multiexcerpt and Multiexcerpt Include macro within the same page.
  • You will run into errors when trying to pull pages using an Include Page macro when the source page has a Multiexcerpt Include macro nested within a Multiexcerpt macro.
  • When content is pulled using the Excerpt Include, Multiexcerpt Include, or Include Page Macro, that content will not appear in Confluence or outside (e.g., Google) search results.
Let me know if you find any more useful macros like these that help to maintain common content from one location, and at the same time also allows the pages that have the pulled content to be searchable within Confluence and from outside sources (e.g., Google).

This article is based on Atlassian Confluence 6.0.7.

Comments

Post a Comment