Help with relative path in hyperlink

Ask here any questions regarding program functionality
blcjr
Posts: 141
Joined: Wed Mar 14, 2012 4:56 pm

Help with relative path in hyperlink

Post by blcjr »

Costas,

I've succeeded in launching PDF's in a gbk module as hyperlinks, but only if I use an absolute path. I like to keep my resources on a flash drive, and the drive letter is subject to change when doing that, so I'd like to use relative paths. But I cannot seem to get it to work.

The following, as an example of an absolute path, works:

file:///F:/theWord+/PDFs/Lange.Schaff.Comm.OT.15Vols.pdf

Here, I keep theWord in "F:/theWord+" (I use the + to distinguish a portable folder that has premium modules in it), so that ../PDFs is at the same level as ../Books or ../Bibles. But if I replace "F:/theWord+" with either ".." or "." the link doesn't work.

Is there a way to use relative paths here?

TIA.

Basil
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Help with relative path in hyperlink

Post by csterg »

You need build 1248 upward for this.
Read here viewtopic.php?p=20837#p20837
Costas
blcjr
Posts: 141
Joined: Wed Mar 14, 2012 4:56 pm

Re: Help with relative path in hyperlink

Post by blcjr »

csterg wrote:You need build 1248 upward for this.
Read here viewtopic.php?p=20837#p20837
Costas
Well, I'm using 1271, so I should be okay on that. Looking at the topic you pointed me to, I understand now that paths should be relative to the directory the module is in. That's what I need to know to get it to work.

Thanks!
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Help with relative path in hyperlink

Post by csterg »

Correct
barolam
Posts: 43
Joined: Sun Mar 27, 2011 10:27 pm

Re: Help with relative path in hyperlink

Post by barolam »

Hi, Costas
I've tried making a relative path link but with no success. Below I will give an example of what I tried, could you point out whatever it is I'm doing wrong:

The file name is Bible Books Chart.pdf. I placed a copy of the file in "...\Program Data\The Word\PDFs" which is one folder away from where the module is in which I'm trying to create a link. In the hyperlink box, I checked manual input and in the Target box typed; "PDFs\\Bible Books Chart.pdf ". In another topic you gave the code: mp3\\track01.mp3 as an example. Am I correct in interpreting the "mp3" before the "\\" as being the relative folder name?

While fiddeling with this to try to make it work, I noticed that my "Program Data" folder is set at "Hidden". I thought maybe this has something to do with it, but maybe not. I was successful in creating absolute path links to files in a folder on my desktop, but not files in "Program Data". I unchecked the "Hidden" box and still nothing.

At this point I'm sure whatever it is I'm doing wrong is so simple it simply eludes me.
Thanks for any help you or anyone else may be able to offer...

p.s. I'm using beta 1282...
Coz
Posts: 47
Joined: Mon Nov 26, 2007 12:46 am

Re: Help with relative path in hyperlink

Post by Coz »

barolam,

It may be that you need to take out the spaces in the link and the file name.

Coz
barolam
Posts: 43
Joined: Sun Mar 27, 2011 10:27 pm

Re: Help with relative path in hyperlink

Post by barolam »

Hi Coz, I just tried what you suggested and still no go...

However, your advice did point out to me that for the absolute path I was trying to make to my "ProgramData" folder, it didn't work because I had a space between "Program" and "Data" which isn't really there. So that issue is solved.

Thanks for your help
blcjr
Posts: 141
Joined: Wed Mar 14, 2012 4:56 pm

Re: Help with relative path in hyperlink

Post by blcjr »

Here's what I've done. Maybe it will help you troubleshoot your situation. I have a module named PDFs.gbk.twm that I use solely to contain hyperlinks to PDF files. Here's a screenshot:

Image

Within the module, links are set up like this:

Image

I keep PDFs in a directory "parallel" (at the same level) as ..\Books, ..\Bibles, etc. So, I just use the relative path ..\PDFs to hyperlink to my PDF files.
barolam
Posts: 43
Joined: Sun Mar 27, 2011 10:27 pm

Re: Help with relative path in hyperlink

Post by barolam »

Hi blcjr, your screen shots pointed out exactly what I had wrong:

I was typing "PDFs\\" but I see it should have been "..\PDFs\".

Thank you for your help, I think I may just borrow your idea of a pdf link module. I have a lot of them in a special folder I keep on my desktop..
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

Re: Help with relative path in hyperlink

Post by csterg »

This is a great tip!
DarrelW
Posts: 1259
Joined: Fri Sep 11, 2009 1:04 am
Location: Klamath Falls, Oregon
Contact:

Re: Help with relative path in hyperlink

Post by DarrelW »

How do you turn off the "Use the topic id instead of the topic in the "Target" checkbox? It is checked and greyed out so I cannot deselect it.

Darrel
DarrelW
Posts: 1259
Joined: Fri Sep 11, 2009 1:04 am
Location: Klamath Falls, Oregon
Contact:

Re: Help with relative path in hyperlink

Post by DarrelW »

Has something changed in the current beta release concerning hyperlinks? I have a number of hyperlinks, shown in the screen shot that used to work but now they do not.

Darrel
Attachments
Screenshot_1.png
Screenshot_1.png (137.98 KiB) Viewed 7129 times
DarrelW
Posts: 1259
Joined: Fri Sep 11, 2009 1:04 am
Location: Klamath Falls, Oregon
Contact:

Re: Help with relative path in hyperlink

Post by DarrelW »

Here is a screen shot showing my directory path to the pdf files.
Attachments
Screenshot_2.png
Screenshot_2.png (115.06 KiB) Viewed 7129 times
User avatar
JG
Posts: 4599
Joined: Wed Jun 04, 2008 8:34 pm

Re: Help with relative path in hyperlink

Post by JG »

Didn't you change to a compact install?
Jon
the
Word 6 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet
DarrelW
Posts: 1259
Joined: Fri Sep 11, 2009 1:04 am
Location: Klamath Falls, Oregon
Contact:

Re: Help with relative path in hyperlink

Post by DarrelW »

I have both - the compact resides and is run from my zip drive. the full version is run from my C drive with all modules residing in program data. This topic is from my full installation. There is no "compact" file in this installation.

Darrel
Post Reply