Skip to main content
Known Participant
December 19, 2010
Answered

How do script a next and previous buttons for browsing between topics utilizing browsing sequence?

  • December 19, 2010
  • 1 reply
  • 976 views

I want to put in "Next Topic" and "Previous Topic" buttons on the top of my page, apart from the the arrows in the TOC. I have set a browse sequence. But I am unalbe to script the buttons. Can anyone help please.

thanks.

This topic has been closed for replies.
Correct answer Willam van Weelden

Hi,

You're certainly on the right track. The problem is that you cannot use a 'hard' path to the images. It may work for topics in the root, the directory images may exist. It may not work for topics elsewhere, because the correct path would be something like '../../Images/'.

Also, you need to add the images as baggage files to your project. If you only use the images in a script, RoboHelp will not recognize them as resources.

I've updated te above article. It now includes how to use images as browse sequence buttons.

Greet,

Willam

1 reply

Willam van Weelden
Inspiring
December 20, 2010

Hi,

With a little JavaScript you can easily add those buttons to your topic. See http://www.wvanweelden.eu/robohelp/webhelp/skinwebhelp/browse_sequences_in_topics for a simple example.

Rick also has a solution in his Skinny on Skins.

Greet,

Willam

Known Participant
December 20, 2010

what I was trying to do is script two buttons instead of displaying text. your links were helpful but i was not able to get the images to display. This is as far as I got:

<p><script type="text/javascript">var sForward = canGo(true);
var sBackward = canGo(false);

if(sForward == true)//If there is a next page, add a link to the next topic.
document.write('<a href="javascript:void(0);" onclick="onNext();"><img src="Images/orange_left.jpg" alt="" style=""width: 24px; height: 19px;" /></a> ');
if(sBackward == true)//If there is a previous page, add a link to the previous topic.
document.write('<a href="javascript:void(0);" onclick="onPrev();"><img src="Images/orange_right.jpg" alt="" style="width: 24px; height: 19px;" /></a>');</script></p>

The images (which are arrows) are not displayig , instead i get an empty place holder in their position.

Any ideas?

thanks.

Willam van Weelden
Willam van WeeldenCorrect answer
Inspiring
December 20, 2010

Hi,

You're certainly on the right track. The problem is that you cannot use a 'hard' path to the images. It may work for topics in the root, the directory images may exist. It may not work for topics elsewhere, because the correct path would be something like '../../Images/'.

Also, you need to add the images as baggage files to your project. If you only use the images in a script, RoboHelp will not recognize them as resources.

I've updated te above article. It now includes how to use images as browse sequence buttons.

Greet,

Willam