We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25046
    • 194 Posts
    I must be missing something here. My images don’t show up in my web pages. When I display the page in the browser and right-click on the image holder, it lists a path of /about/assets/images/image.jpg . However, I know the image is actually at /assets/images/image.jpg

    In the page html I have tried to set the image location manually to /assets/images/image.jpg but it always want to add the directory the current page is on.

    Also, does the assets directory need to have permissions set to 777? It seemed this was the only way to make things work on another site where I wanted my images to show.

    Thanks

      • 25046
      • 194 Posts
      Basically my problem is that ModX is not referencing the the correct location of the image file on the outputted page, even though it finds it correctly in /manager. It appears not to recognize the root (/) sysmbol in the file path that I enter and the automatically generated file path does not work either. I really would like to have my images displayed on my pages but for the life of me cannot figure out how to get this to work. Is this because I am using friendly URL’s? Or is there some configuration setting wrong somewhere? Any help would be greatly appreciated.

      Thanks
        • 25046
        • 194 Posts
        The only solution that seems to work now (which is not a good one) is to move my page to the root level. Then the image path is right and the image displays OK. If I move the page back to be a child of the "About" page, the image link no longer works. Gosh it would be great to know what to do to fix this. . .
          • 25046
          • 194 Posts
          OK, I finally solved my own problem with a bit of weird luck. When I enter the image path in the page HTML, the program seems to strip away the "/" character at the beginning. So, I tried putting two root slashes intead (like this: "//") and now it works. However, each time I edit the image it will try to strip out one of those slashes.
            • 25046
            • 194 Posts
            Rats, now I cannot get the images to work once I edit the page. There are two problems: ModX wants to change the dimensions of the image and it does not find the image properly. Is this is a bug or is there some setting that is wrong somewhere?
              • 34127
              • 135 Posts
              It sounds like something is messed up with your configuration. In your manager click on Tools-->Configuration and take a look at the "Resource Path" and "Resource URL" fields. Are they set properly based on your MODx installation location? You may also want to make sure that the base href tag is in the <head> of your template:

              <base href="[(site_url)]" />


              Also, the assets directory itself doesn’t need to be writable, but the separate directories inside should be writable so that you can upload to them from MODx. But no, they don’t *need* to be writable to see the images. smiley
                • 34162
                • 1 Posts
                I had a similar problem when I wanted to use FCKeditor in modx 0.9.5.

                I use friendly urls and the solution was setting Rewriting browser paths to No.

                Don’t know if it is of any help, but you can certainly try wink
                  • 25046
                  • 194 Posts
                  I did not have this in the head section of my document

                  When you say: <base href="[(site_url)]" /> do you mean I should put it into this form:? <base href="[(http:///www.mysite.com)]" /> or am I confused?

                  Thanks!
                    • 34162
                    • 1 Posts
                    Put it as <base href="[(site_url)]" /> in the head section. [(site_url)] is a variable and will be replaced with the url of your site.

                    The alternative is to put <base href="hxxp://www.mysite.com/" /> in the head section and don’t forget the trailing slash in the url.