We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I have a couple different departments on my website that have lists of definitions on their sites. I've been using getResources for this, with a resource for each definition. But then I showed them how to use symLinks to avoid having to create redundant definition resources on the different sites. Seemed like a good idea, but the getResources calls that listed the content now started just listing the symlink field (the ID of the reference resource).

    I couldn't find a native way in getResources to get the content from the target resource of a symlink, so I made a copy of getResources and added some logic that does it.

    What's the best way to share this for consideration in a future version of getResources?
    • The preferred method is to fork it on github — https://github.com/opengeek/getResources — and submit a pull request.

      Or you could send me an archive of the modified files.

      That said, there should be a simple way to do this in the getResources tpl by simply creating another Snippet to grab the content you want based on the id, class_key, and content field, e.g.

      <div class="resource-content">
      [[getResourceContent? &id=`[[+id]]` &class_key=`[[+class_key]]` &content=`[[+content]]`]]
      </div>
        • 36575
        • 104 Posts
        I would love a copy of this smiley
        • I will try to post to github in the near future. opengeek's solution looks like it would work well too though. I wonder though about calling a snippet repeatedly in the tpl chunk vs. doing the logic right in the getResources call.
            • 36575
            • 104 Posts
            if there is any way you could email me the code [email protected] that would be amazing... i'm working on something right now that I could really use this for. Thanks!
            • Quote from: jrotering at Jul 11, 2012, 07:58 PM
              I will try to post to github in the near future. opengeek's solution looks like it would work well too though. I wonder though about calling a snippet repeatedly in the tpl chunk vs. doing the logic right in the getResources call.
              I don't think you'll see much difference; lookup will still require another query for each item, you'll just be hiding that in another function call (i.e. Snippet).
                • 13808
                • 61 Posts
                I'm also doing a project right now which could make use of this. Are you happy to share it with me? If so I'll PM you some details.
                • Feel free to send me a message.