Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

Exceeding the Content by Label Max Page Limit

Is there a way to get the Content by Label macro to display more than 500 pages?

I think I've got around the 20 label limit but this has me stumped.

If there isn't a way to do this, can anyone recommend an alternative?

2 comments

Hi Mike

This won't get you past the 500 page limit, but we have a section at the top of our pages for related pages using this macro. If we know the list is going to be more than say 15-20 pages, we break it up into multiple lists. Each list uses the Content by label macro with different labels generating different lists of pages. For example, we may have one list for process pages, one for how to, one for training, etc. We find this is more readable.

Thanks, Sandy

Thanks, but unfortunately that isn't going to do it.

This is a scripting language reference with >2000 commands. I want to list the commands available in each version of our product. Each command has a version label.

1.00 started with >1500 available commands and each subsequent release of our product added support for more.

e.g.

  • Version 2.00, aggregate labels 1_00, 1_20, 1_50, and 2_00
  • Version 1.50, it would only be 1_00, 1_20, and 1_50.

I have the same problem: the content by label macro seems to limit the output to 500, doesn't matter what higher limit you define in the macro.

Therefore I created a user macro to give me the entire list:

## Macro title: oce-content-by-label
## Macro has a body: N
##
## Developed by: Stefan Baader
## Date created: 27/09/2017
## Installed by: Stefan Baader

## @param Spacekey:title=Space Key|type=string|desc=Space Key
## @param Label:title=Label|type=string|desc=Label

#set($labelManager = $action.getLabelManager() )
#set($label = $labelManager.getLabel($paramLabel) )

#if(!$paramSpacekey ||  !$paramSpacekey == "")
  #set($spaceKey = $space.getKey() )
#else
  #set($spaceKey = $paramSpacekey)
#end

<h2>List all content of the space $spaceKey with the label $label </h2>

##set($listOfContent = $labelManager.getContentInSpaceForLabel(0, 600, $spaceKey, $label) )

## method deprecated, but works:
#set($listOfContent = $labelManager.getCurrentContentForLabelAndSpace($label, $spaceKey) )

$listOfContent.size() items are found:<br />


#set($i = 0)
<ol>
#foreach($item in $listOfContent)
  #set($i = $i+1)
  <li><a href="$req.contextPath/pages/viewpage.action?pageId=$item.getIdAsString()">$item.getTitle()</li>
#end
</ol>
<hr />
$i items



Thanks, this gives me something to work with.

I haven't tried to code user macros before - any idea how to adapt this to allow multiple labels and sort the list?

Comment

Log in or Sign up to comment
TAGS
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

494 views 24 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you