Relative paths in snippets
Posted: Tue Sep 30, 2008 12:12 pm
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.
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.