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

    Working
    [[$tpl.Link.Item@Business]]
    [[$tpl.Link.Item@Personal]]
    [[getResources? &sortby=`menuindex` &sortdir=`asc` &includeContent=`1` &depth=`0` &showUnpublished=`0` &tpl=`tpl.Link.Item` &includeTVs=`1` ]]


    Not Working
    [[getResources? &sortby=`menuindex` &sortdir=`asc` &includeContent=`1` &depth=`0` &showUnpublished=`0` &tpl=`tpl.Link.Item@Business` &includeTVs=`1` ]]
    [[getResources? &sortby=`menuindex` &sortdir=`asc` &includeContent=`1` &depth=`0` &showUnpublished=`0` &tpl=`tpl.Link.Item@Personal` &includeTVs=`1` ]]


    Or is their another way to skin this cat? I just want to be able to re-use link tpl.

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

      DropboxUploader -- Upload files to a Dropbox account.
      DIG -- Dynamic Image Generator
      gus -- Google URL Shortener
      makeQR -- Uses google chart api to make QR codes.
      MODxTweeter -- Update your twitter status on publish.
    • discuss.answer
      • 3749
      • 24,544 Posts
      I don't think getResources is smart enough to parse those tpl properties. I think it's probably looking for (and not finding) a chunk called tpl.Link.Item@Business. Offhand, I can't think of any way around this short of rewriting the getResources code.
        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
        • 4385
        • 372 Posts
        Quote from: BobRay at Mar 17, 2015, 02:57 AM
        I don't think getResources is smart enough to parse those tpl properties. I think it's probably looking for (and not finding) a chunk called tpl.Link.Item@Business. Offhand, I can't think of any way around this short of rewriting the getResources code.

        Tell Jason to get on it then! wink

        I was trying to workaround have two very similar tpl chunks or using a TV, since all the children of "Business" will have one link and all the children of "Personal" will have another.
          DropboxUploader -- Upload files to a Dropbox account.
          DIG -- Dynamic Image Generator
          gus -- Google URL Shortener
          makeQR -- Uses google chart api to make QR codes.
          MODxTweeter -- Update your twitter status on publish.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You could use output modifiers in the tpl chunk based on the [[+parent]] value.
            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
            • 4385
            • 372 Posts
            Quote from: sottwell at Mar 17, 2015, 12:45 PM
            You could use output modifiers in the tpl chunk based on the [[+parent]] value.

            Yep! That's what I did.

            [[+parent:is=`283`:then=`[[+newBusiness]]`:else=`[[+newPersonal]]`]]


            Thanks for the validation, good to know I came up with the same solution as you.

              DropboxUploader -- Upload files to a Dropbox account.
              DIG -- Dynamic Image Generator
              gus -- Google URL Shortener
              makeQR -- Uses google chart api to make QR codes.
              MODxTweeter -- Update your twitter status on publish.
              • 3749
              • 24,544 Posts
              Quote from: bwente at Mar 17, 2015, 08:03 AM

              I was trying to workaround have two very similar tpl chunks or using a TV, since all the children of "Business" will have one link and all the children of "Personal" will have another.

              If I'm understanding you, it sounds like a good case for an @INHERIT TV.
                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