SKIN ToolBar - icon needs to link to a page in project?

This forum is for all Flare issues related to styles, stylesheets and XML.

SKIN ToolBar - icon needs to link to a page in project?

Postby M33R4 on Wed Apr 07, 2021 5:30 am

I have an icon in my ToolBar named New.

When the user clicks this icon, I want them to be taken to the New topic page within the project.

The button sits here:
Project > Skins > ToolBar > Styles > New

May I have a dummies' guide on how to do this please :?:

Many thanks.
Newbie to MadCap Flare
M33R4
Propeller Head
 
Posts: 61
Joined: Wed Oct 07, 2020 7:58 am
Location: UK

Re: SKIN - icon to link to a page in project?

Postby Dave Lee on Wed Apr 07, 2021 5:44 am

Use javascript in the toolbar event.

For example, this will try to open a file called NewTopic.htm in the same folder:
Code: Select all
window.location.href="NewTopic.htm";


However, that only works if the file is in the same relative position. But if you keep topics in different folders, then the relative path to NewTopic.htm is not going to be fixed.
A more robust solution would be to use an absolute link to the topic in its published location; e.g.
Code: Select all
window.location.href="https://your-site.com/yourhelp/Content/NewTopic.htm";
Dave Lee
Master Propellus Maximus
 
Posts: 5961
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: SKIN ToolBar - icon needs to link to a page in project?

Postby M33R4 on Wed Apr 07, 2021 9:25 am

Thank you Dave Lee.

I don't have my project published yet hence wanted to link the icon to an internal topic page.

I inserted the JS into one icon but don't know why the same JS got inserted in my other icons :shock: ...meaning when the user clicks on any of the icons they will land on the same page.
Newbie to MadCap Flare
M33R4
Propeller Head
 
Posts: 61
Joined: Wed Oct 07, 2020 7:58 am
Location: UK


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 23 guests