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.
SKIN ToolBar-icon needs to link to a page in project?[FIXED]
SKIN ToolBar-icon needs to link to a page in project?[FIXED]
Last edited by M33R4 on Wed Oct 06, 2021 8:06 am, edited 1 time in total.
Newbie to MadCap Flare
Re: SKIN - icon to link to a page in project?
Use javascript in the toolbar event.
For example, this will try to open a file called NewTopic.htm in the same folder:
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.
For example, this will try to open a file called NewTopic.htm in the same folder:
Code: Select all
window.location.href="NewTopic.htm";
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";
Re: SKIN ToolBar - icon needs to link to a page in project?
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 ...meaning when the user clicks on any of the icons they will land on the same page.
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 ...meaning when the user clicks on any of the icons they will land on the same page.
Newbie to MadCap Flare
Re: SKIN - icon to link to a page in project?
Dave Lee wrote:Use javascript in the toolbar event.
For example, this will try to open a file called NewTopic.htm in the same folder: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.Code: Select all
window.location.href="NewTopic.htm";
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";
I've added the code to the Event field on my ToolBar skin.
The page I want a click to take the user to is named toc.htm.
This toc.htm page is saved as 1st level within my Content Explorer:
However, on publication, when I click on the Search icon it's giving me a URL not found page:[/color]
Where am I going wrong please
Thanks.
You do not have the required permissions to view the files attached to this post.
Newbie to MadCap Flare
Re: SKIN ToolBar - icon needs to link to a page in project?
That will only work form topics that are in the same folder - so it'd work from home.htm, but would not work in a topics that are in a sub folder.
That's why I suggest using an absolute link.
That's why I suggest using an absolute link.
Re: SKIN ToolBar - icon needs to link to a page in project?
Good news is that same code eventually started working
Newbie to MadCap Flare