We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    I have "Use Friendly Alias Path" set to ’yes’, because I need to emulate the folder/subfolder based system currently in use on our system. The help blurb for this setting states:

    Setting this option to ’yes’ will display the full path to the Resource if the Resource has an alias. For example, if a Resource with an alias called ’child’ is located inside a container Resource with an alias called ’parent’, then the full alias path to the Resource will be displayed as ’/parent/child.html’.
    NOTE: When setting this option to ’Yes’ (turning on alias paths), reference items (such as images, css, javascripts, etc) use the absolute path: e.g., ’/assets/images’ as opposed to ’assets/images’. By doing so you will prevent the browser (or web server) from appending the relative path to the alias path.


    Is this note saying that instead of typing <a href="[[~17]]">, I need to manually add a leading slash to every link: <a href="/[[~17]]">? Is there a setting somewhere for this?

    Right now if I have a resource 1 w/ alias ’abc’, with a child id 2 alias ’xyz’, and ’abc’ contains a link, ’href="[[~2]]"’, the link will fail because it will point to abc/abc/xyz.html. I’m finding that I need the leading slash.
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: jrotering at Mar 31, 2010, 09:18 AM

      I have "Use Friendly Alias Path" set to ’yes’, because I need to emulate the folder/subfolder based system currently in use on our system. The help blurb for this setting states:

      Setting this option to ’yes’ will display the full path to the Resource if the Resource has an alias. For example, if a Resource with an alias called ’child’ is located inside a container Resource with an alias called ’parent’, then the full alias path to the Resource will be displayed as ’/parent/child.html’.
      NOTE: When setting this option to ’Yes’ (turning on alias paths), reference items (such as images, css, javascripts, etc) use the absolute path: e.g., ’/assets/images’ as opposed to ’assets/images’. By doing so you will prevent the browser (or web server) from appending the relative path to the alias path.


      Is this note saying that instead of typing <a href="[[~17]]">, I need to manually add a leading slash to every link: <a href="/[[~17]]">? Is there a setting somewhere for this?

      Right now if I have a resource 1 w/ alias ’abc’, with a child id 2 alias ’xyz’, and ’abc’ contains a link, ’href="[[~2]]"’, the link will fail because it will point to abc/abc/xyz.html. I’m finding that I need the leading slash.
      Where ever that is from is completely and totally wrong. You always reference things relatively in MODx; NEVER absolutely! All MODx templates should have <base href="[[!++site_url]]" /> at the top of the head before any paths appear. This will solve your issue.