Relative paths in snippets

This forum is for all Flare issues not related to any of the other categories.
Post Reply
bbuchko
Propeller Head
Posts: 59
Joined: Wed Jul 02, 2008 1:32 pm
Location: Raleigh, NC
Contact:

Relative paths in snippets

Post by bbuchko »

Hey folks, this is a neat tip that's probably old news to the pros here but might be useful to other newbies like me.

I have video links in my project, which lead to files outside of the project itself but still in a persistent directory structure, so I used relative paths to link them, such as:
../../../../help_videos/video1.htm

I found myself linking over to the video page a lot, so I decided to just make the video and its description into a snippet. The problem, then, was that my relative path was breaking if I placed the snippet into a topic on a different level of the directory hierarchy.

So, for instance, if I added it to this topic:
/Output/Content/Job_Openings/Adding_Jobs/Uploading_Files.htm (4 levels of directories)

Then I also added it to this topic:
/Output/Content/Portfolios/What_are_Portfolios.htm (3 levels of directories)

One of the two would be broken since they were at different levels of the directory hierarchy (the first would need to backtrack 4 levels while the second only needed to backtrack 3 levels).

So how to fix this problem? What I found was that, if you begin a "Topic in project" link with a slash, Flare automatically adjusts the backtracking to take you back to the target directory. So, instead of the original link above, I could instead use:
/../../../help_videos/video1.htm (also see the attached image)

Now, in my topics, Flare automatically adjusts it to add as many extra levels of backtracking as necessary, based on the topic it's placed into! If I look at the output frame source, sometimes the snippet link is:
../../../../../../help_videos/video1.htm

and sometimes it's only:
../../../../help_videos/video1.htm

Etc.

Verrry handy.
You do not have the required permissions to view the files attached to this post.
Last edited by bbuchko on Tue Sep 30, 2008 2:19 pm, edited 2 times in total.
Bob Buchko
Technical Communicator
Corporate Trainer
Flare Noob
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Relative paths in snippets

Post by KevinDAmery »

Good tip - I've made this post sticky so people can find it more easily.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
MC Hammer
Sr. Propeller Head
Posts: 225
Joined: Wed Aug 08, 2007 3:04 am
Location: In a galaxy far, far away

Re: Relative paths in snippets

Post by MC Hammer »

Sorry but I do not understand why you are using hyperlinks? Don't you insert your snippet in your target topics by going to Insert | Snippet?
Marie-Claire
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Relative paths in snippets

Post by KevinDAmery »

It's a solution for how to have a hyperlink that's part of a snippet work even if the relative paths from the resulting topics are different. It's not about inserting the snippet, it's about making the hyperlink inside the snippet work everywhere in the help system.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
bbuchko
Propeller Head
Posts: 59
Joined: Wed Jul 02, 2008 1:32 pm
Location: Raleigh, NC
Contact:

Re: Relative paths in snippets

Post by bbuchko »

Sorry, I can understand the confusion. I wasn't very clear about that.

As Kevin noted, it's only if you want to include a hyperlink inside of the snippet, and the link is relative instead of absolute (for example, if you want to use "../../NotMyFlareProject/videos/Linkpage.htm" instead of "http://www.myserver.com/NotMyFlareProje ... nkpage.htm").
Bob Buchko
Technical Communicator
Corporate Trainer
Flare Noob
MC Hammer
Sr. Propeller Head
Posts: 225
Joined: Wed Aug 08, 2007 3:04 am
Location: In a galaxy far, far away

Re: Relative paths in snippets

Post by MC Hammer »

Hi both
Thank you for clarifying things for me (I was being a bit thick :oops: ).
I understand now and I have had this issue in the past. It is a nice trick, thanks for sharing, I shall use it!
Marie-Claire
Flare 2019 r2 - Windows 10 Pro - HTML5 help / "clean" XHTML output
JupiterJones
Propeller Head
Posts: 42
Joined: Fri May 23, 2008 2:09 am

Re: Relative paths in snippets

Post by JupiterJones »

Thanks for the tip! I will try it.
I had a similar problem with broken table stylesheet links in some of my snippets...
Post Reply