We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23838
    • 11 Posts
    Hi Forum

    I have just started to use Revolution and have encountered a problem. I am using getResources in a template to display images, but the images are not being outputted.

    Here is the call and chunk:

    [[!getResources? &parents=`6` &tpl=`port-image`]]


    <img src="[[+img]]" alt="[[+pagetitle]]" />


    All that’s being outputted is this: <img src="" alt="New Test" />. The page title placeholder is outputting as it should, but the image TV is blank.

    Can anyone see what I’m doing wrong here? I’m new to Revo so I don’t know if it’s something simple I’m doing wrong or if it has something to do with using friendly URL’s?

    Any help would be much appreciated. Thanks

      • 4172
      • 5,888 Posts
      http://rtfm.modx.com/display/ADDON/getResources

      includeTVs Indicates if TemplateVar values should be included in the properties available to each resource template
      processTVs Indicates if TemplateVar values should be rendered as they would on the resource being summarized
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 23838
        • 11 Posts
        Ok I missed that. I just modified my call, chunk, and tv, but the image is still coming up empty.

        New code:
        [[!getResources? &parents=`6` &tpl=`port-image` &includeTVs=`1` &processTVs=`1`]]

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


        TV is now named tv.img

        Any ideas?
          • 4172
          • 5,888 Posts
          you should name your tv just ’img’ and use the placeholder-tag
          [[+tv.img]] 

          or use the property
          &tvPrefix=``

          then you can use this placeholder:
          [[+img]]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 23838
            • 11 Posts
            Great, it’s working now - thanks!