summaryrefslogtreecommitdiff
path: root/helpcontent2/source/text/shared/guide/hyperlink_rel_abs.xhp
blob: 18cc181950e7e8d8b5d9ee760f6a96d6abb7fcb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?xml version="1.0" encoding="UTF-8"?>



<!--
 ***********************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: hyperlink_rel_abs.xhp,v $
 * $Revision: 1.6 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************
 -->


		<helpdocument version="1.0">
<meta>
<topic id="textsharedguidehyperlink_rel_absxml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">Relative and Absolute Links</title>
<filename>/text/shared/guide/hyperlink_rel_abs.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3147399"><bookmark_value>absolute hyperlinks</bookmark_value>
<bookmark_value>relative hyperlinks</bookmark_value>
<bookmark_value>hyperlinks; relative and absolute</bookmark_value>
<bookmark_value>hyperlinks, see also links</bookmark_value>
</bookmark>
<paragraph role="heading" id="hd_id3147399" xml-lang="en-US" level="1" l10n="U" oldref="45"><variable id="hyperlink_rel_abs"><link href="text/shared/guide/hyperlink_rel_abs.xhp" name="Relative and Absolute Links">Relative and Absolute Links</link>
</variable></paragraph>
<paragraph role="paragraph" id="par_id3153345" xml-lang="en-US" l10n="U" oldref="46">When you include hyperlinks, two factors must be taken into account: whether they are set as relative or absolute on saving, and whether or not the file is present.</paragraph>
<list type="unordered">
<listitem>
<paragraph role="listitem" id="par_id3147008" xml-lang="en-US" l10n="U" oldref="47">Choose <switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - <link href="text/shared/optionen/01010200.xhp" name="Load/Save - General"><emph>Load/Save - General</emph></link> and specify in the <emph>Save URLs relative to</emph> field if $[officename] creates <link href="text/shared/00/00000005.xhp#speichern" name="relative or absolute hyperlinks">relative or absolute hyperlinks</link>. Relative linking is only possible when the document you are working on and the link destination are on the same drive.</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3145382" xml-lang="en-US" l10n="U" oldref="48">You should create the same directory structure on your hard disk as that which exists in the web space hosted by your Internet provider. Call the root directory for the homepage on your hard disk "homepage", for example. The start file is then "index.html", the full path being "C:\homepage\index.html" (assuming Windows operating system). The URL on your Internet provider's server might then be as follows: "http://www.myprovider.com/mypage/index.html". With relative addressing, you indicate the link relative to the location of the output document. For example, if you placed all the graphics for your homepage in a subfolder called "C:\homepage\images", you would need to give the following path to access the graphic "picture.gif": "images\picture.gif". This is the relative path, starting from the location of the file "index.html". On the provider's server, you would place the picture in the folder "mypage/images". When you transfer the document "index.html" to the provider's server through the <emph>File - Save As</emph> dialog, and if you have marked the option <emph>Copy local graphics to Internet</emph> under <emph><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - Load/Save - HTML Compatibility</emph>, $[officename] will automatically copy the graphic to the correct directory on the server.</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3159158" xml-lang="en-US" l10n="U" oldref="49">An absolute path such as "C:\homepage\graphics\picture.gif" would no longer function on the provider server. Neither a server nor the computer of a reader needs to have a C hard drive: operating systems such as Unix or MacOS do not recognize drive letters, and even if the folder homepage\graphics existed, your picture would not be available. It is better to use relative addressing for file links.</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3154046" xml-lang="en-US" l10n="U" oldref="50">A link to a web page, for example, "www.sun.com" or "www.myprovider.com/mypage/index.html" is an absolute link.</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3155450" xml-lang="en-US" l10n="U" oldref="51">$[officename] also reacts differently, depending on whether the file referred to in the link exists, and where it is located. $[officename] checks every new link and sets a target and protocol automatically. The result can be seen in the generated HTML code after saving the source document.</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3145317" xml-lang="en-US" l10n="U" oldref="52">The following rules apply: A relative reference ("graphic/picture.gif") is only possible when both files exist on the same drive. If the files are on different drives in your local file system, the absolute reference follows the "file:" protocol ("file:///data1/xyz/picture.gif"). If the files are on different servers or if the target of the link is not available, the absolute reference uses the "http:" protocol ("http://data2/abc/picture.gif").</paragraph>
</listitem>
<listitem>
<paragraph role="listitem" id="par_id3153541" xml-lang="en-US" l10n="U" oldref="53">Be sure to organize all files for your homepage on the same drive as the start file of the homepage. In this way, $[officename] can set the protocol and target so that the reference on the server is always correct.</paragraph>
</listitem>
</list>
<paragraph role="warning" id="par_id3153897" xml-lang="en-US" l10n="U" oldref="54">When you rest your mouse on a hyperlink, a help tip displays the absolute reference, since $[officename] uses absolute path names internally. The complete path and address can only be seen when you view the result of the HTML export, by loading the HTML file as "Text" or opening it with a text editor.</paragraph>
<embed href="text/shared/00/00000004.xhp#related"/>
<embed href="text/shared/guide/hyperlink_edit.xhp#hyperlink_edit"/>
</body>
</helpdocument>