We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14547
    • 58 Posts
    As the title says; I'm trying to add an imageTV to a chunk and that chunk is used as a getResource tpl.

    Here's how I'm trying to achieve this:

    1. Created a new TV called imageTV:
    Input type = image & output type = default

    2. created a chunk called categories:
    <img src="[[+tv.imageTV]]" alt="[[+pagetitle]]" />


    In the resource, the following snippet call is used:
    [[!getResources? &parents=`[[*id]]` &tpl=`categories`]]


    Result:
    <img alt="Webdesign" src="">


    What am I missing? [ed. note: johnsim last edited this post 13 years, 1 month ago.]
      ~~||[ Simplicity is everything ]||~~
      • 14547
      • 58 Posts
      Added these extra parameters to the getResources snippet call:
       &includeTVs=`1` &processTVs=`1`


      Still the same problem...
        ~~||[ Simplicity is everything ]||~~
        • 37105
        • 194 Posts
        You have to tell getResources to use TV's

        &includeTVs=`1` &processTVs=`1`
          Codeplaza Webdesign: for professional websites at low cost
          • 14547
          • 58 Posts
          Quote from: donquicky at Aug 12, 2013, 04:19 PM
          You have to tell getResources to use TV's

          &includeTVs=`1` &processTVs=`1`

          I did like so:
          [[!getResources? &parents=`[[*id]]` &tpl=`categories` &includeTVs=`1` &processTVs=`1`]]


          But I'm still not getting a valid image URL.
            ~~||[ Simplicity is everything ]||~~
            • 37105
            • 194 Posts
            Try removing

            &processTVs=`1`
              Codeplaza Webdesign: for professional websites at low cost
              • 14547
              • 58 Posts
              Quote from: donquicky at Aug 12, 2013, 04:25 PM
              Try removing

              &processTVs=`1`

              Yeah that fixed it. Thanks!
              But why did I need to leave out processTVs in order to make it work? According to the getResources manual it had to be included:
              http://rtfm.modx.com/extras/revo/getresources#getResources-Examples

                ~~||[ Simplicity is everything ]||~~
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                ProcessTVs will process any selected output widgets. For example, an image TV can be given an image output widget, which will generate the img tags for you. If you just want the raw path to the image, then you don't want an output widget and you don't want the TV processed, you just want its raw content.
                  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
                  • 37105
                  • 194 Posts
                  Thanks Susan, I couldn't clearify this better than you did smiley

                  @John, please set this question to state "Answered"
                    Codeplaza Webdesign: for professional websites at low cost
                    • 14547
                    • 58 Posts
                    @ Sottwell Thank you for the time & for the explanation!
                      ~~||[ Simplicity is everything ]||~~