We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    Hi, I've got a problem with displaying image tv's in a chunk.

    I've got the following settings:
    filemanager_path: assets/uploads/
    filemanager_url: assets/uploads/
    Both set to relative.

    Everything works with this settings, except displaying an image TV in a chunk, like this:

    <img src="[[+tv.theImage]]" />


    This won't work, because the URL is just 'image.jpg', where it should be 'assets/uploads/image.jpg'. It seems like the filemanager path is stripped from the URL.

    Strangely, displaying the same TV in a template with

    <img src="[[*theImage]]" />


    does work. The URL is correct: assets/uploads/image.jpg.

    I use phpthumbof, but not sure if this problem has anything to do with it, obviously the thumb is not displayed, because the URL is wrong.

    Also important: if I set the filemanager_path en filemanager_url back to nothing, this does work. However, this is not really an option because I don't want the user to have access to all directories.

    I'm using MODX Revolution 2.1.3-pl (traditional).

    I already tried a bunch of things, discussed in this threads, but without success:
    https://forums.modx.com/thread/?thread=31485&page=1
    https://forums.modx.com/index.php/topic,63182.msg358026.html#msg358026
      • 19328
      • 433 Posts
      Found a quick fix for this.

      In the chunk, use the snippet call:

      [[!phpthumbof? &input=`assets/uploads/[[+tv.theImage]]` &options=`&w=100&h=100&zc=1`]]


      This works for me, hope it helps someone else!