We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42262
    • 17 Posts
    I can't figure out why getResources is duplicating the first TV's values in the results.

    Here's the call

    [[!getResources?
    &parents=`29`
    &tpl=`OfferTPL`
    &showHidden=`1`
    &limit=`6`
    &includeTVs=`1`
    &processTVs=`1`
    &tvPrefix=``
    ]]

    Here's OfferTPL

    <div><a href="[[~[[+id]]]]"><img src="[[*OrganisationImageTV]]"></a> </div>
    <div>[[*OfferTitleTV]]</div>
    <div>Offer Ends: [[*OfferEndsTV]]</div>
    <a href="[[~[[+id]]]]">
    <input type="submit" class="button" value="See Offer Details">
    </a>


    Incidentally <a href="[[~[[+id]]]]"> is actually outputting the correct ID's

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      Try changing this:

      <div><a href="[[~[[+id]]]]"><img src="[[*OrganisationImageTV]]"></a> </div>
      <div>[[*OfferTitleTV]]</div>


      to this:

      <div><a href="[[~[[+id]]]]"><img src="[[+OrganisationImageTV]]"></a> </div>
      <div>[[+OfferTitleTV]]</div>


      Your code is getting the TV value from the current resource rather than from getResources.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 42262
        • 17 Posts
        BobRay thank you! I've spent half a day trying to sort this. I'm embarrassed it was something so simple. Much appreciated
          • 3749
          • 24,544 Posts
          Don't feel bad, I've seen that mistake hundreds of times. wink
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting