Page Tree Search Macro

Add the Page Tree Search macro to a page to provide users with a way to search for pages in a specific page hierarchy. 

This macro is useful when you want to provide a way to search:

  • one section of the current space, such as in a knowledge base
  • a specific part of a page hierarchy, such as one project in a space that contains multiple projects.

After someone enters a keyword and clicks the Search button on this macro, the results are presented on Confluence's advanced search screen. 

On this page:

Screenshot: Page Tree Search macro on a Confluence page. 

For a better search experience, check out the Livesearch Macro, or enable the integrated search field in the Page Tree Macro.

Add this macro to your page

To add the Page Tree Search macro to a page:

  1. From the editor toolbar, choose Insert > Other Macros.
  2. Choose Page Tree Search from the Confluence content category.
  3. Choose the number of page versions to display. 
  4. Choose Insert

You can then publish your page to see the macro in action. 

Change the macro parameters

Macro parameters are used to change the behaviour of a macro.

To change the macro parameters:

  1. In the editor, click the macro placeholder and choose Edit.
  2. Update the parameters as required then choose Insert.

Here's a list of the parameters available in this macro. 

Parameter

Default

Description

Name of Root Page
(root

none

The name of the root page whose hierarchy of pages will be searched by this macro. If this not specified, the root page is the current page.

Note: Unlike the Page Tree macro, the Page Tree Search macro does not accept the special values that start with an @ sign, such as @home or @self.

Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the macro browser, it will be listed below in brackets (example).

Other ways to add this macro

Add this macro as you type

Type followed by the start of the macro name, to see a list of macros. 

Add this macro using wiki markup

This is useful when you want to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.

Macro name: pagetreesearch

Macro body: None.

{pagetreesearch:root=My page name}
Last modified on Oct 13, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.