Atlassian's "Insert Confluence List" macro. How do I search for pages with specific label tagged?

MSanchez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

I'm using Atlassian's "Insert Confluence List" macro on a confluence page.

I need to search for a specific label that is tagged on some confluence pages. The issue I have when I put this label in the search using the "Insert Confluence List" macro is that the search results I receive are in the thousands, not just the pages with the specific label applied.

 

I've tried to refine the search using the "labelText:" operator as:

 

labelText:YOURLABEL

 

I've even tried the space filter with the above operator shown below and it still doesn't provide just the label as my results.

labelText:YOURLABEL AND spacekey:YOURSPACEKEY

 

macro.jpg

macro form.jpg

2 answers

0 votes
Hamza Sual
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

In Atlassian Confluence, you can use the "Content by Label" macro to search for and display pages with specific labels. Here's how you can do it:


Steps to Use the "Content by Label" Macro

  1. Edit the Page:

    • Navigate to the page where you want to insert the list of tagged pages.
    • Click the "Edit" button.
  2. Insert the Macro:

    • In the editor, click the "/" key or the "+" button (Insert menu).
    • Search for and select the "Content by Label" macro.
  3. Configure the Macro:

    • In the macro configuration dialog:
      • Labels: Enter the label(s) you want to filter by.
        • For multiple labels, only pages tagged with all specified labels will appear.
      • Spaces: Choose a specific space to limit the search or leave it blank for all spaces.
      • Sort by: Select how the results should be sorted (e.g., title, modified date, etc.).
      • Maximum Results: Set the number of results to display.
  4. Insert the Macro:

    • Click "Insert" to add the macro to your page.
    • The macro will dynamically generate a list of pages tagged with the specified labels.
  5. Publish the Page:

    • Once you're satisfied with the setup, publish the page to see the generated list.

Advanced Tips

  • Search with Multiple Labels:

    • Use the "Content by Label" macro with multiple labels if you want to refine results further. For instance, entering project and 2024 will show pages with both labels.
  • Saved Filters:

    • If you frequently use the same label combinations, consider saving those filters in commonly accessed pages.
  • Search for Labels in the Search Bar:

    • Type labelText:your-label in the Confluence search bar to find all pages tagged with
0 votes
Laurie Sciutti
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2024

Hi @MSanchez and welcome to the Community!  Have you tried the "Content by Label" macro?

MSanchez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2024

HI @Laurie Sciutti, Thank you for responding!

The "Content by Label" macro is great because the search returns the correct pages that have the label. However, I need to display certain page metrics which only seemed to be available when using the "Insert confluence list" macro. The metrics I need to display along with the page label are: pager version, updated at, updated by, and version number. The table format with the different column options is perfect from the "Content by Label" macro. 

Laurie Sciutti
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2024

Ah...I see @MSanchez .  disclaimer:  I have not previously used this macro as I'm still using Data Center but I played around with it in my Cloud sandbox and got it to work by inserting the macro, editing it using the Edit search query and then Edit link options in the table.  This really doesn't seem like it should be how this works and I was not able to actually find documentation on this specific macro but I may be missing something.

Capture.PNG

 

My search query looked similar to this:  https://<yourspaceURL>/wiki/search?spaces=XXX&labels=xxx

 

HTH!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events