Enllaços relatius i absoluts
Quan inseriu enllaços, heu de tindre en compte dos factors: si s'han definit com a relatius o absoluts en guardar-los, i si el fitxer és present.
-
Trieu LibreOffice - PreferènciesEines - Opcions - Carrega/guarda - General i indiqueu en el camp Guarda els URL relatius a si el LibreOffice ha de crear enllaços relatius o absoluts. L'enllaçament relatiu només es pot fer quan el document en què treballeu i la destinació de l'enllaç són a la mateixa unitat.
-
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.
-
Un enllaç a una pàgina web, com ara "www.exemple.com" o "www.elmeuproveïdor.com/lamevapàgina/index.html", és un enllaç absolut.
-
El LibreOffice actua de manera diferent segons si el fitxer a què fa referència l'enllaç existeix i segons on estiga ubicat. El LibreOffice comprova cada enllaç nou i estableix un protocol i una destinació automàticament. El resultat es visualitza en el codi HTML que es genera en guardar el document d'origen.
-
S'apliquen els criteris següents: una referència relativa ("gràfic/imatge.gif") només és possible quan ambdós fitxers es troben a la mateixa unitat. Si els fitxers es troben en unitats diferents del sistema de fitxers local, la referència absoluta es posa darrere del protocol "file:" ("file:///dades1/xyz/imatge.gif"). Si els fitxers són en servidors diferents, o si la destinació de l'enllaç no està disponible, la referència absoluta utilitza el protocol "http:" ("http://dades2/abc/imatge.gif").
-
Assegureu-vos d'organitzar tots els fitxers de la pàgina inicial a la mateixa unitat que el fitxer inicial de la pàgina inicial. D'esta manera, el LibreOffice pot establir el protocol i la destinació perquè la referència en el servidor sempre siga correcta.
Quan poseu el ratolí damunt d'un enllaç, un indicador d'ajuda mostra la referència absoluta, ja que el LibreOffice utilitza noms de camins absoluts internament. L'adreça i el camí complets només són visibles quan visualitzeu el resultat de l'exportació HTML, carregant el fitxer HTML com un "Text" o obrint-lo amb un editor de text.