We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37758
    • 73 Posts
    OK, this is driving me mad and I am wondering if this is a bug or a lack of knowledge. I am working with Revo 2.2.6 traditional. I have a site that I am developing which sits in a subdir like so
    wwwroot/sites/site_1
    I have set up all the client assets to be uploaded to siteroot/assets/content

    In my 'Resource URL' setting in system is set to assets/content/

    Now, in my media sources, I have to set 'basePath' and 'baseUrl' to 'sites/site_1/assets/content/', otherwise I don't get access to the images etc. However, when I then go and add an image that I assign via a TV, the outcome is that in the source I get a path like this 'sites/site_1/sites/site_1/assets/content/'. I don't understand what I am doing wrong here. Questions are
    - is there any connection here with the core/config.inc.php?
    - is there a problem with setting up modx in a subdir?
    - I have tried to establish what the connection is between the system setting, the media source and the config file but couldn't find anywhere where that's explained?
    - can someone help me to make this work?

    Thanks
    • If you are going to use relative paths, they have to be relative to your MODx installation, not your web root. If you need to use absolute paths, make sure to include the leading / - in your case, /sites/site_1/assets/content/, and then indicate that these are not relative paths and URLs. Keep in mind that an absolute path must begin at the server's file system root, not the web root. Perhaps something like /home/mydomain/public_html/sites/site_1/assets/content/. Absolute URLs begin from the web root.
        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
        • 37758
        • 73 Posts
        Thanks for the reply. OK, sorry, I meant to say site root not web root. So, I have now left them relative and entered my 'basePath' and 'baseUrl' to '/assets/content/'. This now means that in my file browser I can only see the top level folder "Files", and nothing more, which means I can't actually chose any files. Adding "/sites/site_1" means I can browse and choose files, but when I insert a file, I get the doubling up of the path in the source of the page??
        • Are you sure that you changed the two fields to indicate that these are not relative paths?

          I've never had a problem with relative path and URL (just assets/content/, no leading slash) with installations in subdirectories, so I'm not sure why it wouldn't work for you.
            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
            • 37758
            • 73 Posts
            Yes I am sure, just double checked - cleared the cache and all. What, if anything, is the connection between the media source path and the "Resource URL" setting in the system settings?