Page 1 of 1

[Solved] Hyperlink - Relative references

PostPosted: Mon Dec 15, 2014 3:21 pm
by nunof32
Hello,

I think I need a little help here.

First of all : I use a Mac and Open Office for Mac. OS is newest (10.10.1). OO is 4.1.1.

I have 2 documents sitting in the same folder. document1 has a hyperlink to document2. I need these two documents to travel from system to system (OS X to Windows to Unix to ...). The assumption is that when imported onto a new system these two files will always reside in the same directory. So, I need to define the hyperlink with only the filename of document2 – the expectation is that the rest of the path will always be assumed by the host filesystem to be 'current directory').

Accordingly, I define the target as : file:///document2

Doesn't work : OO says the file doesn't exist (I think because it is not looking in the right directory).

The help file, hyperlink topic, directs me to go to OO>Preferences>LoadSave>General and then specify that I want hyperlink references to be stored in relative, rather than absolute, form. It seems that on the Mac that option is not present ?!

Any help welcome, thanks in advance.

Re: hyperlink - relative references

PostPosted: Mon Dec 15, 2014 4:58 pm
by acknak
OO always constructs links relative to the location of the document, even though it displays file locations as full paths. Just link the documents normally, so it works on your system, then move the documents (together) somewhere else and try the link again: it should "just work".

OO seems to have a problem with this (in some situation) when working under Windows, but I've never had a problem with it under Linux; I expect MacOS is ok as well.

Re: hyperlink - relative references

PostPosted: Mon Dec 15, 2014 5:23 pm
by Lupp
acknak wrote:OO always constructs links relative to the location of the document, even though it displays file locations as full paths.

Might this not depend on the setting under > 'Tools' > 'Options' > 'Load/Save' > section 'Save' > 'Save URLs relative to the file system: 'ticked'
when the file is saved?

Editing:
I tested it with a couple of Calc files one of which is containing references into three others. Saving it with the above mentioned option not ticked led to broken links as soon as the complete set of files was moved to another folder.
This is the behaviour of LibreOffice. It's surely the same with AOO, OOo as it was since StarOffice 5.2 (at least).
There is also the option 'Save URLs relative to the internet' with the respective effect.

Re: hyperlink - relative references

PostPosted: Mon Dec 15, 2014 5:45 pm
by acknak
Good point!

Re: hyperlink - relative references

PostPosted: Mon Dec 15, 2014 6:49 pm
by nunof32
Thanks acknak and lupp for your help.

I made a few tests and verified that hyperlinks are stored relative (= filename only) or absolute (= full path) according to the setting referred to by lupp (in the OSX implementation that setting is under OO>Preferences>Load/Save>General>Save section). I have verified this by moving around the files within OSX and also by transferring them to a Windows system.

Thanks very much again.

Re: Hyperlink - Relative references

PostPosted: Mon Jan 05, 2015 1:32 am
by NascarNana
NascarNana, OO 4.1.1, Win 7
The links between files saved in C:\Users\N\My Documents\*.odt appear to be broken. Other *.odt file not save in My Documents all appear to available. Error messages come up in OO and Win Explorer. The only problem I have dealt with since this happened were some unwanted programs that loaded during Adobe Flash update. Can't remember any other problems.

Re: [Solved] Hyperlink - Relative references

PostPosted: Mon Jan 05, 2015 7:00 am
by NascarNana
Thank you. I will give it a try.