We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34120
    • 236 Posts
    Possibly a very basic question here, I’m using getResources to output a list of thumbnails with text for a portfolio, this bit is working fine. On each thumbnail I need an external link to a website. I think I need to use a weblink for this but I’m not sure how I would incorporate this into the getResources, How would I link to the weblink ID from getResources?

    Hope that’s clear, any help much appreciated.

    Thanks
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: rf9 at Oct 13, 2010, 11:16 AM

      Possibly a very basic question here, I’m using getResources to output a list of thumbnails with text for a portfolio, this bit is working fine. On each thumbnail I need an external link to a website. I think I need to use a weblink for this but I’m not sure how I would incorporate this into the getResources, How would I link to the weblink ID from getResources?
      I think doing something like this in your getResources tpl to create your links is what you are looking for (if I understand your question properly):
      <a href="[[+class_key:eq=`modWebLink`:then=`[[+content]]`:else=`[[~[[+id]]]]`]]">[[+menutitle:default=`[[+pagetitle]]`]]</a>

      This simply says if the class_key of the Resource is modWebLink, then the href is the content of the Resource, else it’s the standard internal link.
      Note that you will need to set the includeContent property to 1.