Page Info Macro displays source page info when nested on other pages with the Include Excerpt macro

I have a created a standard wiki template for a wiki subspace but people (being people) sometimes forget to use it, so I want to be able to copy the template header into those new pages, to maintain at least the semblance of uniformity.

The template header includes "created by" and "modified by" info via the Page Information Macro. I excerpt the template header on the template page but when I include it on another page via the Excerpt Include macro it shows the wrong Page Info (i.e. created-user/date, modified-user/date).

Can I nest these macros together or should I just copy the template header directly into these other pages? If I change the template header in the future, then I'd like to avoid a copy & paste into every page in the wiki subspace that wasn't created using the standard template.

1 answer

1 accepted

Hi,

The Excerpt macro only shows the content of the other page, so what you describe seems consistent with what I would expect to see.

As for your goal of having pages in a space have the same look and feel, You can edit the default page layout for pages in a specific space.

Navigate to: Space Tools(bottom left when on a page)-->Look and Feel-->Layout-->edit the page layout.

Search for the <div id="main-content" class="wiki-content"> element. Then just above the $body variable we can add some custom content, something like this: 

This adds some meta data to each page in a space.

<div id="main-content" class="wiki-content">
<div>
Created by: $page.creator.getName()
</div>
<div>
Last modified time: $confPage.getLastModificationDate()
</div>
<div>
Last modified by: $confPage.getLastModifier().getFullName()
</div>
$body
</div>

 

This will propagate to all the pages in the space so use with care.

 

If the answer solves your question, please mark it as accepted so that other people with the same question can benefit from it.

The issue is that I'm not the space admin. I'm just trying to control the look & feel of a sub-space sized area for my team, we also don't want to create more spaces because that just silos information. If I want to enforce a consistent page layout, I guess I'll need to copy & paste the header on to all our pages.

thanks

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
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

967 views 23 12
Join discussion

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