We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11858
    • 130 Posts

    I have a page which looks like this:

    Root
    |
    + Category
    |
    + Subfolder
    |
    + Item 01
    + Item 02 etc.

    the address of the site is www.root.com/category/subfolder/Item01.htm with Friendly URLS and paths turned on. The problem is the "subfolder" prefix is added to all the relative paths of all images inserted after the "category" folder. so the rightful path of an image (assets/images/image01.jpg) turns into assets/subfolder/images/image01.jpg, which breaks the link huh.

    How can I tell MODx not to add the "subfolder" into relative paths for items which are more than 2 deep in the site structure?

    Thanks!
      • 4872
      • 12 Posts
      Try to use fix/absolute path instead of relative path for linking to assets file. May it can help ?
        • 10487 MODX Staff
        • 1,535 Posts
        How can I tell MODx not to add the "subfolder" into relative paths for items which are more than 2 deep in the site structure?
        Add this into the <head> of your template:
        <base href="[(site_url)]"></base>

        With that in your template, you still use relative links in your documents.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 11858
          • 130 Posts
          Thanks garryn, that worked. I had it in there but it was outside the head tag just before the body tag!!!

          Cheers