Skip to main content
February 3, 2011
Question

RH9 HTML - a back-to-top button for long topics

  • February 3, 2011
  • 1 reply
  • 4347 views

Is it possible for Robohelp to automatically generate a back to top of page button whenever I create a long topic?

This topic has been closed for replies.

1 reply

RoboColum_n_
Legend
February 4, 2011

You could handle this by use of a master page. This could be setup with a bookmark (e.g. called "top") and a hyperlink at the bottom linked to it. If both the bookmark and the link were part of the master page body, this would do exactly what you want. Then you just need to assign the master page to the required topics.


  The RoboColum(n)   @robocolumn   Colum McAndrew
February 4, 2011

I use this code:

<p class="top"><a class="topic" title="Return to Top" href="#">↑ Top</a></p>

Paste it at the bottom of the HTML page before thelast body tag.

The ↑ Top remains visible at all time.

Jac

Peter Grainge
Community Expert
Community Expert
February 27, 2012

Hi,

Thanks for your "top of page" code, it was exactly what I was looking for.  However, I've run into a bit of an issue...

I tested MergeThis' code/css on a few pages of my document.  I made a few modifications based on our own standards and all went well.  So I began the task of adding this feature to only those pages which require a bit of scrolling.  After a few insertions, I realized that it would be better to make it a snippet, that way, if things change later on, I only need to modify the snippet. (of course).  I made this a snippet then added it to a bunch of files, then stopped to test it.  Well, when the doc is generated, it adds "href=../../../#" to the original href="#" depending on location of the particular file and the location of the snippet file.  Ok, so I shouldn't do this type of thing in snippets.

So, to save some time and avoid rework, I deleted the snippet and selected "Delete Snippet And Replace References With Actual Content". I assumed that the code itself would be added to each file, and the actual snippet would be removed from the Snippet pod.   This did not happen, the snippet entry in the Snippets pod was removed, but the files still contained references to the snippet. 

what did I do wrong?

RH8.02.208

WebHelp

(comment on the snippets: I can't add the "top of page" stuff to the master page because I use Zoom search, which causes me to manually add breadcrumbs, to use the <!--ZOOMSTOP--> and ZOOMRESTART comments; and I only want "top of page" to appear on those pages which require scrolling.  This isn't a global thing..



You are not doing anything wrong. RoboHelp Snippets are designed to be created in one place and any relative path gets "helpfully" amended if the topic is several levels down. That you have discovered.

I'm not sure what happened then as I just added a snippet to four topics and saved. Then I deleted the snippet from the pod and selected the third option, the one you specified. The snippet was deleted from the pod and the topics then had the text, albeit with the paths prefixed but that is a simple tidy up.

I have tested in RoboHelp 9 but I'm pretty sure it would be the same in 8. Perhaps try in a test project?


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.