We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49562
    • 25 Posts
    HTML:
    <a href="http://localhost/manager/templates/muravey/img/r4_big.jpg" class="grouped_elements" rel="group1"> [[!getPhoto1]]</a>
    

    I use lightbox. Getting images this way: [[!getPhoto1]].

    Snippet code:
    return '<img src="' . $modx->getObject('modResource', 4)->getTVValue('photo1') . '">';

    I want to get image path, now this doesnt work. $modx->getObject('modResource', 4)->getTVValue('photo1') - this returns the image, not the path. How can I get it?

    And how can I get the link to photo1 TV?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Do you have the TV itself configured to use an output type of "Image"? If you just want the path, make sure to leave the output type at "Default".
        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
        • 49562
        • 25 Posts
        Now it is configured as image. If I configure it as Default - what to do later?
          • 30585
          • 833 Posts
          The default output gives you the image path. With that, you won't need to change your snippet.

          Essentially
          getTVValue('photo1')
          will output something like this:
          /path/to/myimage.jpg
          which is what I think you want.
            A MODx Fanatic