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

How to add next and previous buttons on each page of the Confluence system automatically?

rr September 8, 2011

The idea is to have next and previous button on each of the page on Confluence without manually adding these links.

10 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2012

Hi all,

we do not use "next" and "previous" buttons, but a combination of excerpts and children:

On the top of pages which belong together, we have two columns:

- the first column shows a list of the children, this list is marked as an excerpt. Additionally in this column is the toc of this site, but not included in the excerpt.

- included in the second column is the excerpt of the parent page. This excerpt shows all the pages in the same hierarchy level as the one you are watching and you can jump to every other page (and you do not have to klick "back" all over again). Additionally there is a link to the parent page, if you want to go up in the page hierarchy.

Maybe this is an idea for your problem.

Best regards

Thomas

Bruce Schneider April 13, 2018

This is brilliant.  Thanks for sharing this idea!

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2018

Thank you, @Bruce Schneider 

An answer from 2012 and it's still appreciated, that's great :-)

Philip Kyler November 2, 2018

@Thomas Schlegel 

Any chance that I can see an example of this? I'm trying to accomplish something very similar for breaking down a list of steps for multi-layered tasks. I'm having a hard time picturing how the excerpts are set up.

Thanks!

Like John Walker likes this
Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 2, 2018

@Philip Kyler - of course, I will post an example on Monday

Like Vladislav Belyaev likes this
Philip Kyler November 3, 2018

That would be super! Here is a screen cap of what I have going on so far. It's not amazing, and please excuse the blurring of the tool names. The idea was to easily make a navigation table at the top of the pages consisting of all the steps needed in order to deploy a new account. This would allow you to jump up or down a level as needed. We're not in a position to purchase many add-ons or templates, so I am teaching myself how this works.  Talk with you soon, @Thomas Schlegel 2018-11-03_09-08-06.png

Like Manny Hernandez likes this
5 votes
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
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 8, 2011

There is the scrollbar macro that is part of the Navigation plugin - https://plugins.atlassian.com/plugin/details/170

If you want this to be automatic for all pages in a space (or entire site), you can customize your page layout (Space Admin -> Layout, or site wide with Administration -> Layout) to include it before and/or after the body:

## customize
$helper.renderConfluenceMacro("{scrollbar}")
## end customize
        <div class="wiki-content">
           $body
        </div>
## customize
$helper.renderConfluenceMacro("{scrollbar}")
## end customize

ashan August 1, 2013

Should we add this under Administration -> Layout -> Page Layout pls?

Like Tomas Husar likes this
Stefan Baader January 19, 2015

The scrollbar macro is no longer available for CONF 5.5 and by the way it was slowing down the performance of the system for lager space hierarchies

Philip Kyler November 2, 2018

I am not sure if this is still available for installation since it's been archived or disabled.

3 votes
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.
February 23, 2012

I wrote a macro that does this. Here's a link:

http://confluence.atlassian.com/display/DISC/Next+and+Previous+Links

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.
February 27, 2012

Hi Matt,

That is a great macro (and doesn't require the use of a plugin!) However, I am having a problem. Rather than use arrows for the links, I decided to use the pages' names instead. I have modified the final part of your macro thusly:

## Could easily replace the basic arrow images with grayed out ones and dead links if you want no wrapping and/or are at the first page.
 ## Use the $config object (of type BootStrapManager) to get the domain name
 ## Define the Next and Previous links
 &lt;a href="$config.getDomainName()$myArray.get($prev).getUrlPath()"&gt;$myArray.get($prev).getDisplayTitle()&lt;/a&gt;&lt;a href="$config.getDomainName()$myArray.get($next).getUrlPath()"&gt;$myArray.get($next).getDisplayTitle()&lt;/a&gt;
#end

The problem I am having is that when I do this, it is putting in about a thousand non-breaking spaces before the first link, causing the links to jetty of the side of the page. What's wrong? Is there another way to achieve this?

Cheers

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.
February 27, 2012

Hi Matt,

That is a great macro (and doesn't require the use of a plugin!) However, I am having a problem. Rather than use arrows for the links, I decided to use the pages' names instead. I have modified the final part of your macro thusly:

## Could easily replace the basic arrow images with grayed out ones and dead links if you want no wrapping and/or are at the first page.
 ## Use the $config object (of type BootStrapManager) to get the domain name
 ## Define the Next and Previous links
 &lt;a href="$config.getDomainName()$myArray.get($prev).getUrlPath()"&gt;$myArray.get($prev).getDisplayTitle()&lt;/a&gt;&lt;a href="$config.getDomainName()$myArray.get($next).getUrlPath()"&gt;$myArray.get($next).getDisplayTitle()&lt;/a&gt;
#end

The problem I am having is that when I do this, it is putting in about a thousand non-breaking spaces before the first link, causing the links to jetty of the side of the page. What's wrong? Is there another way to achieve this?

Cheers

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.
February 27, 2012

I should, actually, point out that I get the 1000 &nbsp;s when I implement your macro as it is anyway. Do you get this?

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.
February 27, 2012

Hmmm, I hadn't noticed that. I'll take a look and let you know what I find out. THanks!

matt

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.
February 27, 2012

I took a look and could not replicate this problem. I am using Confluence 4.1.2.

I tried your modification and it worked for me. Take a look at the code that wraps the macro (in the Page Layout), and see if there's any tags or loops that might not be getting closed.

Another idea (and this is a logn shot) is that maybe you have a document with a special character in the URL path that is causing my macro to go into a loop. I wonder if the actual number of nbsp's is either the same as, or a number that is divisible by, the number of documents in your space.

matt

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.
February 28, 2012

It's not any of those things. In the end it's not so bad, I wrote some jQuery which strips out the non-breaking spaces. It's not ideal but it's not so bad.

Thanks!

1 vote
Stefan Baader December 1, 2014

Since the scroolbar macro is no longer working and was in the past slowing down when used in a space with many pages it would be interesting to have someting similar to browse through the order of pages. Like reading a book. When having parent or child pages there could be a "page up" link (for parent) or a list of child pages. Is it possible to create something like that with the API and user macro / velocity?

1 vote
ashan July 31, 2013

How can I add this macro to the documentation theme's page layout please? Confluence only allows to customize the default theme and I tried editing the doctheme.jar files but they dob't work well with the macro.

1 vote
Chris Johnson April 19, 2012

I would bet that most people think of previous and next the following way.

Where ever one might be viewing a page in a heirarchal structure of pages, presumably all siblings are related to the parent page in some way. Hence, it's often logical to want to read another child of the same parent -- that is, sibling -- after reading the current child page. Sometimes one wants to read the "previous" sibling and other times one wants to read the "next" sibling.

In practice, an author providing such links will likely provide content of the siblings that makes sense to organize this way, and even more so, will likely order the sibling pages such that previous and next make the most sense.

I'm surprised that Atlassian hasn't figured this most basic and highly useful idea out. Numerous useful, online documentation sites are structured this way.

0 votes
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.
February 23, 2012

I can confirm that this plugin still works with Confluence 4.1.

0 votes
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.
February 17, 2012

I'll explain it. There are pages 1, 2, and 3 -- I know, this example follows a "book" metaphor, but it's the way some users think still... When the user is on page 2, I want to embed a link to go to page 3 (next) and 1 (previous).

0 votes
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.
February 17, 2012

I'll explain it. There are pages 1, 2, and 3 -- I know, this example follows a "book" metaphor, but it's the way some users think still... When the user is on page 2, I want to embed a link to go to page 3 (next) and 1 (previous).

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2011

What do you mean by "next" and "previous"?

If you can explain what you want them to do, then you can probably get some macro suggestions. But I can't imagine what you mean by next and previous, because that implies a simple flat list of pages, and that's not how Confluence is structured.

rr September 8, 2011

So the ides is to provide a next and previous link at the bottom of each page. The current documentation theme for Confluence does a great job at organizing the content. But when a user browses through a particular page and reaches the end of the page, he has no way of knowing the parent element of that page unless he goes back to the page tree.

The next and previous button will help in adding a sense of direction to the user.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2011

That still doesn't quite explain what you expect them to do. Bob's scrollbar suggestion is exactly right when it comes to navigating through single pages, but it doesn't provide next/previous navigation. Can you explain exactly what you expect to happen when the user clicks "next" or "previous"?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events