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

Include macro in Confluence Custom HTML

Matt Johnson May 28, 2013

I would like to know if it's possible to include a macro in the Custom HTML at the end of the body in Confluence. We would like to add the viewtracker plugin to every page, but I've been unable to find a viable solution for that. If the macro can't be included there, does anybody have an idea how we can add those statistics to each page without having to manually add to every page?

The issue is that we would like to see the page views for blog posts, which can contain macros, however the blog posts cannot be created from a template. No template means it's totally up to the user to add the tracking info macro at creation, which could be mandated but I'm not optimistic that our userbase would always add it.

Thanks in advance for any help.


2 answers

1 accepted

0 votes
Answer accepted
Amalia San May 28, 2013

Hi MJ!

I don't think it's possible to include macro in Custom HTML. However, you have the option of including the macro in one of Confluence Layouts by adding the following velocity code:


This will render macro in the layout. You can add this in a Global Layout, Page Layout, or Blog Post Layout. However, please note that this will only work if you are using the Default Confluence Theme and not Documentation Theme.

Hope it helps!

Matt Johnson May 28, 2013

Hi Amalia,

Thank you for your reply. Unfortunately we are using the Documentation Theme and chaning to the Confluence Default would cause my users to revolt. I did find that I can add to the Documentation Theme footer, however that does not display the macro on the Blog Post pages. One step closer to an answer though, so thank you again.


Amalia San May 29, 2013

There is no straight forward way to customize the Documentation Theme, other than editing the JAR file itself. Go to <confluence-install>/confluence/WEB-INF/classes/com/atlassian/confluence/setup and open (if you are on Confluence 5.x and above, go to <confluence-install>/confluence/WEB-INF/atlassian-bundled-plugins). Locate and open usage-doctheme--x.xx.x.jar which is the JAR file of the Doc Theme. The file that you need to look at is located in decorators, called page.vmd. Please refer to the following documentation for more info:

Once the file is edited, you can then save the file and JAR file and then restart Confluence

Amalia San May 30, 2013

Sorry there's a typo there. It should be doctheme-x.xx.x.jar

0 votes
Amalia San May 30, 2013

sorry there's a typo. It should be doctheme-x.xx.x.jar

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

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

970 views 0 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