Skip to main content
Known Participant
April 24, 2011
Question

How to give a relative path from a button in the master page header?

  • April 24, 2011
  • 1 reply
  • 2217 views

so I have this code in the header of my Master page in RoboHelp:

<input type="image" value="View graphics legend"

onclick="window.location.href='Graphics_legend.htm'"
src="Images\graphic legend.png" name="image1"
title="View graphics legend" style="width: 118px; height: 21px;" />


i need to call the 'Graphics_legend.htm' file which is sitting in the root folder. When i try this it works fine for the html file which are in the root folder as well, but anything with is in a sub directory , the button stops working.

It might be just to add a realtive path ,but i am failing to understand how to make a relative path for 'Graphics_legend.htm' ,.. ?

This topic has been closed for replies.

1 reply

Captiv8r
Legend
April 25, 2011

Hi there

Relative paths are relatively simple once you get the hang of them.

For example, if you want to refer to something that is one folder above where you are, you prefix things with ../

The ../ is HTML shorthand meaning one folder level above where I am. If you wish to go two folder levels up, ../../

If you need to drop into a folder that is at the same level as where you are, ../FolderName

From what you have written it would seem that RoboHelp isn't seeing your code and properly calculating the path. That's really not too surprising because you are using the Button element.

If you are using CSS and linking to a style sheet you likely have a simple way to calculate what the relative path should be. Just examine the source code of the topic and note what prefixes the CSS file name. Assuming your CSS is in the project root (and it should be) then you could use the same prefix.

Hopefully this helps... Rick

Helpful and Handy Links

RoboHelp Wish Form/Bug Reporting Form

Begin learning RoboHelp HTML 7, 8 or 9 within the day!

Adobe Certified RoboHelp HTML Training

SorcerStone Blog

RoboHelp eBooks

Peter Grainge
Community Expert
Community Expert
April 25, 2011

If you need to drop into a folder that is at the same level as where you are, ../FolderName

I think that is a typo and that Rick meant ./FolderName. (A single full stop / period)


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.