Relative og absolutte lenker
NÄr du setter inn hyperlenker, mÄ du ta hensyn til to faktorer: Om du angir lenkene som relative eller absolutte nÄr du lagrer, og om filen finnes.
-
Choose LibreOffice - PreferencesTools - Options - Load/Save - General and specify in the Save URLs relative to field if LibreOffice creates relative or absolute hyperlinks. Relative linking is only possible when the document you are working on and the link destination are on the same drive.
-
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 File - Save As dialog, and if you have marked the option Copy local images to Internet under LibreOffice - PreferencesTools - Options - Load/Save - HTML Compatibility, LibreOffice will automatically copy the graphic to the correct directory on the server.
-
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.
-
En lenke til en nettside, for eksempel «www.openoffice.org» eller «www.minleverandÞr.no/minside/index.html» er en absolutt lenke.
-
LibreOffice reagerer ogsÄ forskjellig avhengig av om filen som viser til i lenka finnes og hvor den er plassert. LibreOffice kontrollerer alle nye lenker og velger automatisk et mÄl og en protokoll. Resultatet kan ses i den opprettede HTML-koden etter Ä ha lagret kildedokumentet.
-
De fÞlgende reglene gjelder: En relativ referanse («bilder/bilde.gif») er bare mulig nÄr begge filene finnes pÄ den samme stasjonen. Hvis filene er pÄ forskjellige stasjoner i det lokale filsystemet, vil den absolutte referansen bruke «file:»-protokollen («file:///data1/xyz/bilde.gif»). Hvis filene finnes pÄ forskjellige tjenere, eller hvis mÄlet for lenka ikke er tilgjengelig, vil den absolutte referansen bruke «http:»-protokollen («http://data2/abc/bilde.gif»).
-
Pass pÄ at du plasserer alle filene som skal brukes pÄ hjemmesiden, pÄ samme stasjon som startfila for hjemmesiden. PÄ denne mÄten kan LibreOffice velge protokollen og mÄlet slik at referansen pÄ tjeneren alltid er riktig.

NÄr du holder musa over en hyperlenke viser et hjelpetips den absolutte referansen, siden LibreOffice bruker absolutte stinavn internt. Den fullstendige stien og adressen er bare synlig nÄr du viser resultatet av HTML-eksporten ved Ä laste inn HTML-fila som «Tekst», eller nÄr du Äpner den i et skriveprogram.