We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37271 ☆ A M B ☆
    • 11 Posts
    I have assigned media sources for imageTV in Revo 2.2.0 (localhost, MAMP), but MODX doesn't append base url to images in HTML output.

    I have two contexts, web and en, so in the first context image is visible, but in another context not, because of not adding assets absolute path.

    If (editing TV in resource) I add base_url manually, image becomes visible. How to make that working, not to add
    [[++base_url]]
    there every time? By the way, if in media source basePath and baseUrl is assets/, MODX also doesn't append full path to image. I've set this to / otherwise I should add base_url also in web context. Please, any advice, how to solve that!



    ....after hours trying to find solution now is possible to add images in both contexts, but only through default Media Source: Filesystem, basePath and baseUrl is set to /. Images are displayed but in HTML output are two slashes (like here: https://forums.modx.com/thread/45779/image-file-path-adding-two-slashes-works-but-weird): <img src="/www.mysite.com//assets/components/iamges/imagejpg" alt="" />
    Bug?
    [ed. note: oranged last edited this post 14 years, 7 months ago.]
      www.oranza.com
      • 37271 ☆ A M B ☆
      • 11 Posts
      Solved. Couldn't find in TV where to assign to Media Source. Under "Source" in Media Source tab in default is nothing visible and that's why is difficult to find out where to click to assign.
        www.oranza.com
        • 42892
        • 44 Posts
        You need to create the Media Source, Assign the Media Source to the TV in TV Settings -> Medis Sources Tab (assign it for all contexts where you want to use it).

        For usage in the Frontend (where the basePath/baseUrl is missing), you have to "process the template variable" if you use it in a snippet, like with getResources.