Does Confluence have a plugin or macro that shows 'Where Used' information?

Does Confluence have a macro or plugin that allows you to post a listing of where an article is reference in other articles?  I'd like to create a definitions/ acronym listing, and a "Where Used" capability similar to that found in MediaWiki would be useful to show where the terms are being used elsewhere in the library.

2 answers

1 vote
Davin Studer Community Champion Nov 30, 2015

Not sure I totally understand what you are asking, but are you looking for a referring content macro? If so here is a user macro that will do that. If that is not what you are asking then sorry.

Update: Added title, show title, and hide on include parameters.

Macro Body Processing:
No macro body 


## Developed by: Davin Studer
## Date created: 06/26/2014
## @param Title:title=Title|type=string|required=false|default=Referring Content|desc=The title for the list.
## @param ShowTitle:title=Show title|type=boolean|required=false|default=true|desc=Show the "Pages that link here" title for the list.
## @param Hide:title=Hide on include|type=boolean|required=false|default=true|desc=If this page is included on another page then hide the referring content links.
#set ($d = '$')
#set ($pages = $linkManager.getReferringContent($content))
#if($pages.size() > 0)
    #if($paramShowTitle == true && $paramTitle && $paramTitle != "")
<p id="referring-content-title$" class="referring-content-links-title">$paramTitle</p>
<ul id="referring-content-page$" class="referring-content-links" style="display: none;">
    #foreach($page in $pages)
        #if (!$page.isDeleted())
    <li><a href="$page.getUrlPath()">$page.getTitle()</a></li>
<style type="text/css">
.referring-content-links-title {font-weight: bold;}
<script type="text/javascript">
AJS.toInit(function() {
    var hideOnInclude$ = $paramHide;
    var originalPage$ = '$';
    if(hideOnInclude$ && originalPage$ != AJS.params.pageId) {
        AJS.${d}('#referring-content-page${}').css('display', 'none');
    } else {
        AJS.${d}('#referring-content-page${}').css('display', 'block');

This works great; thank you Davin! The only thing I'd like to see is a checkbox to hide the results from where the page is used as an include, or hide from view completely. I just used the Page Properties macro which has a Hide checkbox to keep it from appearing, and since the results are listed when editing the user macro, the report is just what I needed.

Davin Studer Community Champion Dec 02, 2015

I'm not quite understanding what you are asking in regards to the checkbox.

So I have a snippet that I use in an Include Page macro on another page, if that snippet page includes your Referrer Report user macro (as I call it), then the list of pages produced by the user macro also appears on the page using the Include Page macro. I would like the list of pages to NOT show up when the containing page is included elsewhere. I suppose I could put the snippet text into an Excerpt macro and use the Include Excerpt macro instead of the Include Page macro; it would just take time to redo all the reusable content.

Davin Studer Community Champion Dec 02, 2015

Ah got it. Hmm ... off the top of my head I'm not sure there would be a way to code that into a user macro. I'll give it some thought, and see if I can work something up.

Davin Studer Community Champion Dec 02, 2015

Ok. I think I've worked something up that should work. I've edited the above code.

Brilliant! One last humble request; the option to display a title of the report: Even a static "Pages that link here" so that it's clear what the list represents.

Davin Studer Community Champion Dec 02, 2015

K. Edit is above.

Nice! But I think Hide on include should hide the title too.

Unfortunately, I am not a Wiki developer, but rather a Wiki user/author, so I'm looking more for a canned technology added to the "Insert More Content" | "Other Macros" toolbar in Confluence. I wouldn't know what to do with raw code.

Davin Studer Community Champion Dec 03, 2015

Once this is added as a user macro by a system admin it will show up in the macro browser as a regular macro.

Last I checked, there is an "incoming-links" macro as part of the Confluence Linking plugin:

Don't forget you need to get the free license from ServiceRocket before using it (you can find a link under "Documentation" on the Marketplace page).

No, not looking for incoming-links, but rather outgoing links. 'What links here?' is another term I've seen. For example, I could create a Wiki article titled "verification" where we define the term "verification". Other articles can reference the verification article in the body of the text. At the bottom of the "verification" article, you can add a "Where Used/What Links Here" macro that shows articles where "verification" was referenced. It's an interesting technique of threading articles together via a glossary. Especially useful for acronym listings.

Davin Studer Community Champion Dec 01, 2015

The user macro I provided below will do what you want. It will show you referring links (pages that link to the current page). This will obviously only work for wiki links. Anything external to the wiki or links in the wiki created as "Web Links" won't show.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

473 views 3 18
Read article

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