On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I have a multi language/context setup for 2 languages (DE/EN):
    - domain.com/de/
    - domain.com/en/

    All the image TVs have wrong assets paths now. For example a image tv has the following path:
    - /en/assets/myimage.jpg

    Can i change this to something without the language prefix?
    - /assets/myimage.jpg

    This question has been answered by multiple community members. See the first response.

    • This doesn't answer your questions, but one way to go would be to create assets_url and assets_path Context settings for each context that included the /en/.

      Removing the /en/ from the URL is easy enough with an .htaccess rewrite, but it might interfere with your multi-language routing, your existing resource URIs, or any frozen URIs. It's worth a try, though.

      RewriteRule ^(?:en|de)/(.*)$ /$1 [L]

      I'm not familiar enough with multi-language, multi-context sites to suggest how to do it without messing up the routing. Maybe some one else will chime in.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • discuss.answer
        Set the in media source of that TV the relative base url to false.
        • Thanks BobRay, the last years i allways did multi language sites the way you showed. But i would like to get writ of the htaccess stuff and better have the correct tv-path.

          Jako, i thought the same and allready changed the "baseUrlRelative" to false and the "baseUrl" to "/assets/uploads/...". But that still does not remove the language subfolder from the url of the image. It just changed the url from "de/assets/..." to /de/assets/...".
          Content-Blocks for example works perfects and alle the images have the correct url now: "/assets/uploads/..."

          Thanks for your help.
          • discuss.answer
            Just in case someone else has the same Problem:

            The Problem was phpThumbOf. You also have to set the setting to something absolute like "/" or "/assets/uploads/":
            phpthumbof.cache_url => /assets/uploads/

            Also set settings for your meda-source to:
            baseUrlRelative => false
            baseUrl => /assets/uploads/

            Thanks to Jako for the Support.