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

    Not quite sure how to fix this. When I import assets, images for example in a document or folder that is one level deep (ie: newcfk.com/about-change-for-kids), the image shows up fine. For example the image path would be this: assets/images/photos/bio-photos/3121045381.jpg

    However, when in a document or folder that is beyond one level deep (ie: newcfk.com/about-change-for-kids/meet-the-team), MODx still inserts the same path: assets/images/photos/bio-photos/3121045381.jpg and the image does not show up.

    If I manually add [(site_url)] to the beginning of the path it works fine, but how do I get MODx to automatically know the path based on how many levels deep the document is? It tried adding [(site_url)] to resource URL in Tools > Configuration, but that didn’t work.

    Thanks in advance for any advice!
    - Jess

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Try putting a meta tag
      <base href="[(base_url)]"></base>

      in your template head. This form of the meta tag should be used to avoid problems with various versions of IE that choke on the self-closing format.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 20508
        • 157 Posts
        Great, that worked - thank you!
        One last thing, when using the file manager, I can’t actually see any of the photos - I get the broken link image (with the question mark), although the images import just fine.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          If you can, right-click on the broken image and see what path it thinks it’s supposed to be using. Compare this with what the path is near the bottom of the phpinfo() view in Reports -> System info. Sounds like you need to adjust the paths in the Configuration.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 20508
            • 157 Posts
            yes, sorry I should have posted the file path I copied earlier. it looks like this:
            http://a2s38.a2hosting.com/~cfknyc/newcfk.com/manager/..%2Fassets%2Fimages%2Fphotos%2F3-column-template%2F3171431280.jpg



            I updated the File Manager Path in Tools > Configuration > File Manager from "/home/cfknyc/public_html/newcfk.com/" to "/home/cfknyc/public_html/newcfk.com/manager" I was able to a see images in the File Manger now, but when I try to access the File Manger: Resources > Manager Files, I get this message:

            Directory listing for:/

            Access denied!

            Solved one problem, which created another. tongue


              • 33337
              • 3,975 Posts
              I have seen problems in MODx when u have this in path: ~

              a2s38.a2hosting.com/~cfknyc/newcfk.com

              Try using subdomain instead of that url, and it should work fine.

              Hope it helps.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 22303 MODX Staff
                • 10,725 Posts
                The File Manager does not allow access to the files in manager/. Never has.
                  • 20508
                  • 157 Posts
                  Thanks Zi, I’ll try that!
                    • 20508
                    • 157 Posts
                    The <base href="[(base_url)]"></base> doesn’t seem to work on pages you link to via the text editor though - or maybe this is a separate issue: link url’s that are populated like this: [~55~] don’t point to the right directory...

                      • 22303 MODX Staff
                      • 10,725 Posts
                      Quote from: msflux at May 18, 2009, 12:18 PM

                      The <base href="[(base_url)]"></base> doesn’t seem to work on pages you link to via the text editor though - or maybe this is a separate issue: link url’s that are populated like this: [~55~] don’t point to the right directory...
                      That should be site_url, not base_url...