Writer/Web Relative address URL's fail

Discuss the word processor
Post Reply
gpowell
Posts: 2
Joined: Mon Feb 04, 2008 12:23 am

Writer/Web Relative address URL's fail

Post by gpowell »

I can not get the Writer Web to accept relative URL addresses. I don't want most of my URL's to be saved as relative addresses. For instance I want a URl of ../index.html to be saved a such. The help for URL says

File System
Select this box for relative saving of URLs in the file system.
Internet
Select this box for relative saving of URLs in the Internet.

It does not seem to matter what I select it always converts my URL's to a complete path.

I am using the latest release of OpenOffice on Windows XP.

Any suggestions.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Writer/Web Relative address URL's fail

Post by acknak »

Have you looked at the generated HTML? Can you give us an example where it has failed?

Writer always displays URLs as full absolute paths, but it maintains knowledge of the relative locations and it should use that in the exported HTML, if possible.

I don't think the settings under Tools > Options > Load/Save > General are what you want. To be honest, I don't know what they actually are for--the online help is not clear to me at least, but I don't think they have anything to do with the way OOo handles URLs inside your document.
AOO4/LO5 • Linux • Fedora 23
gpowell
Posts: 2
Joined: Mon Feb 04, 2008 12:23 am

Re: Writer/Web Relative address URL's fail

Post by gpowell »

Set Tools - Options- Load/Save - General - Save URL Relative where both "File system" and "Internet" are checked.

Now go start a new HTML document by clicking on File - New - HTML Document.

Click on the hyperlink icon.

The hyperlink windows popup opens.

Select Internet, enter junk.html in the target and Junk Document for the text, and click apply.

Observe what was put into the status bar for the text and the URL. For me the URL shows http://junk.html/ not junk.html or ./junk.html.

Now change the selection to Document and enter junk.html in the target and Junk Document for the text,and click apply.
Observe what is pu intothe status bar for text and the URL. for me it shows the text but no URL.
So click on View-HTML source You will get a popup to save the document. So save it as "Testing Relative.html" Now viewing the html will show a relative address of <P><A HREF="junk.html">junk document </A> Looks good.

Now go back to Web View and Exit OpenOffice Writer.

Open OpenOffice Writer and open file "Testing Relative.html.

Put your cursor somewher on Junk Document. Look at the status bar for the URL for Junk Document. I show a URL of file:///C:/Inetpub/wwwroot/junk.html

Click on the URL icon for the text Junk Document. I show a path of file:///C:/Inetpub/wwwroot/junk.html

Now go view the HTML. i still have a URL of <P><A HREF="junk.html">junk document </A>

go back to Web Layout View

Now go add the letter s to junk document so it is now Junk documents.

Go view the HTML

I no longer have a relative address. I have <P><A HREF="../../../../../Inetpub/wwwroot/junk.html">junk doucuments</A></P>

So for me relative address fails as I create and edit my HTML files.
User avatar
Hagar Delest
Moderator
Posts: 33633
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Writer/Web Relative address URL's fail

Post by Hagar Delest »

Have you tried to move your test page with its structure to check how the links are handled?
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Writer/Web Relative address URL's fail

Post by acknak »

Sorry, I can't quite follow your steps. You seem to be going through a lot more steps than should be needed.

The goal, as I understand it, is to create one HTML document (let's call it "main.html") that links to another HTML document (let's call that one "link_target.html") using only relative locations in the URL--so the two html files can be moved around and have the URLs remain correct.

So, I created the link target document:
1) File > New > HTML Document
2) Typing...
3) Save > "link_target" (i.e., "link_target.html")

Now, I create the main document:
4) File > New > HTML Document
5) Typing...
6) Save > "main" (i.e., "main.html")
7) Select the link text
8) Click the hyperlink toolbar button
9) Select "Document" as the link type at the left
10) Click the "File Browser" button to the right of the "Path" entry
11) Select the "link_target.html" document
12) Click "Apply" to create the link.

This is the point where I made the screenshot. You can see the two Writer/Web documents and the hyperlink dialog. Note that the tooltip shows a full file path when it hovers over the link. The hyperlink dialog also shows a full, absolute path.

Now, I looked at the HTML source:
13) View > Source

That's the inset portion in the screenshot. Note that the actual link URL is purely relative. There is no extra path information at all. OOo displays the location as if it were a full path, I suppose so that you can know exactly what file it points to, but the actual HTML link is relative.

If I move the link_target document to a subdirectory named "dt", and repeat the hyperlink step, the URL is HREF="dt/link_target.html". If I move it to the parent directory, the URL is HREF="../link_target.html", and if I move it to a different sub-directory off the parent, then the URL is HREF="../temp/link_target.html".

Now, I'm running OOo on Linux, so I can't say that it works the same on Windows, but it ought to.

See if those steps work for you--or if I've misunderstood your recipe somehow, explain what steps I've left out.
Attachments
links.png
AOO4/LO5 • Linux • Fedora 23
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Writer/Web Relative address URL's fail

Post by foxcole »

gpowell wrote:I can not get the Writer Web to accept relative URL addresses. I don't want most of my URL's to be saved as relative addresses
:?: Do these sentences contradict each other, or am I just having a typical Fried-day?
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Post Reply