We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35560
    • 7 Posts
    I cannot get phpthumbof to work in a chunk. I think it may have to do with the path to the image? It works fine in a template, but not in chunks. For example:

    Template (works):
    <img src="[[*ItemImage:phpthumbof=`wl=400&hp=400&zc=1`]]" alt="[[pagetitle]]" />
    (TV returns the full URL: ’http://dev.example.com/images/folder/example.jpg’)

    Chunk (called by a snippet; does not work):
    <img src="[[+tv.ItemImage:phpthumbof=`w=215&h=215&zc=1`]]" alt="[[+pagetitle]]" />
    (TV returns relative URL only: ’folder/example.jpg’)

    ...My hypothesis is that the TV is returning a filename only, not a full path to the file itself, causing phpthumbof to fail. If this is the case, how would I change this? I would be very grateful for any thoughts or advice. Thanks in advance.

    MODX Revolution 2.1.2-pl (traditional)
    OS: linux
    PHP Version 5.2.17
    Apache/2.2.19 (Unix)
      • 35560
      • 7 Posts
      This issue was basically solved in another thread: http://modxcms.com/forums/index.php/topic,67341.0.html

      However -- does anybody know why an image TV will return a different URL, depending on where the TV is referenced?

      E.g., from a template:

      [[*ItemImage`]]
      TV returns the full URL: ’http://dev.example.com/images/folder/example.jpg’

      or, from a chunk:

      [[+tv.ItemImage`]]
      TV returns relative URL only: ’folder/example.jpg’

      I am bewildered by the logic of this. If I change the input options on the TV, such as setting the TV paths/urls to be the site root, then it all works. But this also means that the content editor person who updates the TV must first drill down into subfolders where images are to be kept, and they see the site root in their file browser. Personally, I never ever want content editors to access the site root; I want them restricted to a subfolder such as ’/assets/resources.’

      Please, help!