Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to add pagination to content by label macro

Karina Green January 28, 2019

Please  help, I am new to confluence and need to add pagination to my dynamic pages which are created by using content by label macro.

Is there any code out there with an example of what needs to be done to add pagination to the content by label macro? 

Do I need to create a new user macro? 

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2019

Karina,

The Content by Label macro does not create pages, but rather inserts a macro into your existing page that displays all content in Confluence with a label you specify.

By default, this will show up to 15 pages but can be increased up to 500. There is pagination at the bottom of this macro in order to help you navigate.

If you are dynamically generating pages that contain the Content by Label macro, we'll need to know the process you are using to accomplish this, in order for us to know how to tell you to paginate your results.

Regards,

Shannon

Karina Green January 30, 2019

I am using a label to create my dynamic pages sorted by creation date I am displaying excerpts from different pages with the same label.

If I select to show just 15 excerpts of the query how can I add a page ribbon or next/previous buttons to view the next 15 excerpts on another page?

I need a pagination ribbon or next/ previous button to go to the next 15 excerpts of the content by label query. 

If I have 100 documents and I want to show 15 documents per page, I need a way to get to the next 15 documents using pagination.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2019

Karina,

How exactly are you using the label to create dynamic pages? Is there a script or add-on that you're using?

It's not clear from your description what we're working with here, so please provide more details about this setup and what exactly you did to get this to work.

It sounds like it was something developed in-house, and you might need to speak to the same team who created this in order to add pagination.

Regards,

Shannon

Karina Green January 31, 2019

I think what I am calling dynamic pages are confusing you,so forget i mentioned dynamic pages. I am adding a label video to each of the stories that have been created and then use the content by label macro to pull in excerpts from each of these stories. The page, the content by label macro is on shows 15 story excerpts. I need a page ribbon or a button at the end of this page to show the next 15 story excerpts on another page. I don't want to have all excerpts listed on one page, I want a page ribbon or next/previous link  so I can go to the next 15 story excerpts that have the label video.

2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 NEXT >>

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 31, 2019

Karina,

I see; so to verify, you are splitting your Content by Label results across several pages rather than one page, so the pagination results on the macro itself isn't useful for you.

The main thing I would recommend, which you've probably already done, is have one parent page that collects these pages, and each page with a CBL macro is a child of that page.

You could then use a similar solution to the threads below:

Unfortunately the Next and Previous Links document that is referenced in the second link is no longer available, but you should have the basic idea.

Essentially, you'll need to write a User Macro to accomplish this.

 

It might also be worth checking out our Marketplace Apps, in case there are any navigation add-ons available to accomplish your requirement.

Regards,

Shannon

sean_morgan
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!
August 30, 2019

@Shannon S I have a question about 

By default, this will show up to 15 pages but can be increased up to 500. There is pagination at the bottom of this macro in order to help you navigate.

Italic emphasis added by me.

I can certainly see in the macro edit where I can control the number of things but don't see anywhere to control or enable pagination or any navigation within the results.  The feature you're describing isn't referenced in the Content by Label Macro documentation that I can see. Is it specific to a particular version or just to cloud instances?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 2, 2019

Hello Sean,

This is a bit of an older thread, but I made a mistake in interpreting what the macro does, and I've not been able to test this myself as I don't have a Confluence instance that has that many pages in it which are labeled.

The pages that it displays are actual Confluence pages. So, if you want to display 500 pages of Confluence that use that label, the functionality mentioned in Content by Label Macro documentation is the one you change:

Maximum Number of Pages

Limit the number of items to include in the list. This can be any value up to 500 pages.

This does not include pagination, as I am now learning. If you want to add pagination you would need to try editing the macro, if you are comfortable with modifying source code. There's one solution here you can try:

If you still have any issues, I recommend raising a new question, and our Community can help with that. I don't personally have experience with modifying the built-in macros in this way, but I know a lot of our community has and would be able to help you with that.

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events