Skip to main content
Inspiring
November 25, 2023
Answered

Site setup – "Document" or "Site root"

  • November 25, 2023
  • 2 replies
  • 357 views

Hello

 

In the "local info" tab of the "Site setup" dialog box the user has a choice of "Links relative to document" or "Links relative to site root". In all the videos, books, chats, tutorials that I have looked at i have never seen any explanation of  which one to click on.  "Documents" seems to be the default choice and that is working OK for me, but i don't like clicking on things blindly, not knowing what they mean.

 

Can anyone explain the meaning of these two choices? Thanks

 

Kevin

    This topic has been closed for replies.
    Correct answer Nancy OShea

    Unless you work with dynamic data and a local testing server, it doesn't matter which you use as long as you're consistent.   

     

    See below for more details about the differences between Absolute, Document & Site-Root relative link paths.

    https://helpx.adobe.com/dreamweaver/using/linking-navigation.html

     

    Hope that helps.  Post back if you have any questions.

     

     

    2 replies

    Community Expert
    November 27, 2023

    Well, @B i r n o u had prepared a note dedicated to certain interns some time ago to detail this question, so here it is :

     

    To help you make the right choice regarding the relativity of the link between pointing to the document or pointing to the site, there's no single, categorical answer. It very much depends on our approach and the way we design our tree structure.

    However, there's nothing to stop us from using one or the other alternately, and also combining them within the same document.

    Let's take a simple, pragmatic example:

     

    At the root of a website, say one has two folders, a css folder containing the page layout styles, and at the same level a second folder team containing a tree structure detailing the structure's team.

    Alongside these two folders one will also find the index.php file.

    Within the team folder, one could imagine a team.php document and an images folder containing images of each team member.

    So as not to blur the process, here's an image of this organization

    So, depending on the links to IMG and CSS files, what type of link should be used within the team.php document?

    What type of links would be appropriate and why? relative to the site, or to the document...? well, in this case both...

     

    Basically concerning IMG, a document-related type of link to connect the images to the "trombinoscope" contained in the file will be recommended,

    <img src="images/bob.webp" alt="Team member picture">
    <img src="images/rita.webp" alt="Team member picture">
    <img src="images/ernest.webp" alt="Team member picture">
    <img src="images/ginette.webp" alt="Team member picture">

    instead of using

    <img src="/team/images/bob.webp" alt="Team member picture">
    <img src="/team/images/rita.webp" alt="Team member picture">
    <img src="/team/images/ernest.webp" alt="Team member picture">
    <img src="/team/images/ginette.webp" alt="Team member picture">

     

    Why?

    Simply because the root type of link is more direct (less verbose), simpler, and in this case, apparently the team folder represents an encapsulated module which, should it be moved in the site tree, seems likely to remain identical and therefore not break the internal links established with the images.


    And a type of link relative to the site to link the style sheet to the teamp.php document,

    <link href="/css/styles.css" rel="stylesheet" type="text/css">

    instead of

    <link href="../css/styles.css" rel="stylesheet" type="text/css">

    Why ?

    In fact, this time for two reasons :

    • If we consider that the team folder is a module, there is probably some chance that with the evolution of the site, it will have to be moved in the structure, and therefore , we had already seen that the images would follow this evolution, and so do the link to the css file.
    • And because this will make it possible to us to use exactly the same link to link the CSS file from the index.php file placed at the root of the site, and therefore to share this insertion from an include file without any trouble.

     

    Here's hoping that the instant translation of this note, originally in French, hasn't altered the meaning of the original content!

    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    November 26, 2023

    Unless you work with dynamic data and a local testing server, it doesn't matter which you use as long as you're consistent.   

     

    See below for more details about the differences between Absolute, Document & Site-Root relative link paths.

    https://helpx.adobe.com/dreamweaver/using/linking-navigation.html

     

    Hope that helps.  Post back if you have any questions.

     

     

    Nancy O'Shea— Product User & Community Expert