How can I search for where a page is included in Confluence?

Dave Bacher [analog] June 8, 2012

We use the "Include Page" macro extensively in Confluence for managing content that needs to be consistent across our documentation such as product names and common instructions. Sometimes when editing an included page, it's useful to see where the page is included. Is there any way to search within Confluence for where a page is included? Is there a plugin that provides this sort of advanced search?

5 answers

2 votes
Karl M Kovaciny August 20, 2017

When I am on a page and choose Page Information from the ... menu, the "Links to this page" section contains pages that include this page.

Azfar Masut
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2018

Thanks!

1 vote
Liz Canham March 9, 2014

I'm sorry I have no answer to the question, but wanted to bump it up in case anyone else out there has found a workaround solution.

We're placing images and video content in an 'Inclusion Library', as suggested by Sarah Maddox in her book 'Confluence, Tech Comm, Chocolate', but what is not covered in the book is what to do when you update the page in the Inclusion Library. In other words, how do you ensure the updated content is still relevant to the pages where it has been included?

We need to find out where a page has been included. Can anyone help with this please?

1 vote
Steve Goldberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2013

Just came across this post while looking for something else.

If you're willing to do manual work then you can do a search for any macro by doing a search for "macroName: include*" - note that this is case-sensitive. It will list every page which uses that macro. You can't, AFAIK, add parameters (e.g., which specific include page you're looking for), but at least you can find out every page that has an include.

For more info: http://ffeathers.wordpress.com/2011/11/04/how-to-search-confluence-for-usage-of-a-macro/

Dave Bacher [analog] October 1, 2013

Thanks, that's a good tip. We use the include macro so heavily that knowing a list of pages that contain includes isn't enough (there are hundreds), its necessary to find the list of pages that (recursively) include a given target.

1 vote
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2012

I would write a macro. Here are the steps that should help you get started:

1. Get the root page of the space.

2. Load a sorted list of all child pages. Each page will be a ContentEntityObject. API details here: http://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/core/ContentEntityObject.html

3. Iterate over each page in the list.

4. On each iteration, call the getAttachmentsNamed() method on the page, and pass in the current page's name as the String argument. See the API for more info: http://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/core/ContentEntityObject.html#getAttachmentNamed(java.lang.String)

Dave Bacher [analog] June 10, 2012

Interesting idea. I didn't know macros could do so much. To get started, I stole some code from "List attachment on another page", but I don't see any of my included pages in the list of attachments.

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2012

You know what, I think I misread your original post. Not sure if there's a way to find included pages (at least, not as attachments). There are a bunch of isIncluded() and similar sounding methods in the API, but without much doc on them, it's hard to tell if any would work.

0 votes
Dave Bacher [analog] June 19, 2012

In case my solution is useful to anyone else, I wrote my own "search engine" in python using the XML-RPC API to index content from all pages. It has a simple web interface that links to all pages that include a given target page.

I'm sure there's a more efficient way to do this with a Confluence plugin (or Gadget?), but I haven't yet figured out where to get started with that.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events