We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi all,

    I have a getResources call, which calls in all the children from my page, with a thumbnail for each, which is pulled in from a TV in each child [[*Image]]

    Here is the call:
    [[getResources?
    &depth=`0`
    &includeContent=`1`
    &includeTVs=`1`
    &includeTVList=`Image`
    &processTVs=`1`
    &processTVList=`Image`
    &tpl=`2016CategoryListingTpl`
    ]]
    


    The TPL is here:

    <li>
        <a href="[[~[[+id]]]]">
         <img src="[[+tv.Image:pthumb=`&w=640&h=640&zc=1&aoe=1&f=jpg&q=50`]]" alt="" />
         <h3>[[+pagetitle:htmlent]]</h3>
         <p>[[+introtext]]</p>
        </a>
    </li>
    


    This works fine for normal resources.
    But within the children, there are a few Symlinks.
    For these, all it pulls in is the [[*pagetitle]], but not the [[*introtext]] or [[*Image]]

    I cannot work out why.

    I have checked the system setting: symlink_merge_fields and this is set to YES, which should mean that it pulls in all fields from the original resource.

    Any idea what I am doing wrong?

    Thanks
    Andy

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

      • 3749
      • 24,544 Posts
      Do the normal pages and the Symlink have the same template?

      Are the introtext and image set on the Symlink resource, or just on the resource the Symlink points to?

        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
        • 51020
        • 670 Posts
        Quote from: BobRay at Nov 08, 2017, 10:58 AM
        Do the normal pages and the Symlink have the same template?

        Are the introtext and image set on the Symlink resource, or just on the resource the Symlink points to?


        Hi Bob,

        Yes the normal pages and symlinks have the same template.
        The introtext and Image are not set on the symlink resource - they are just on the resource the Symlink points to.


        Thanks
        Andy
          • 3749
          • 24,544 Posts
          You may have to set them on the Symlink resource. If that doesn't work, something's definitely weird.
            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
            • 51020
            • 670 Posts
            Quote from: BobRay at Nov 08, 2017, 04:55 PM
            You may have to set them on the Symlink resource. If that doesn't work, something's definitely weird.

            It works if I set them on the symlink resource but it would be much cleaner and safer if I could bring the data across from the original. I thought that would be possible.
            It works in the symlink resource itself - just not in the getResources call from its parent

            [ed. note: tm2000 last edited this post 8 years, 10 months ago.]
              • 3749
              • 24,544 Posts
              AFAIK, getResources doesn't know Symlinks exist.

              You set symlink_merge_fields, but you might try messing with forward_merge_excludes. They default to content, pub_date, unpub_date, richtext, _content, and _processed, which is why your other stuff is not getting through.

              I'm not sure it would work with TVs, but it's worth a try. You should be able to set both symlink_merge_fields and forward_merge_excludes as properties in the getResources tag. The second one should be a comma-separated list of your extra fields (the defaults will be used automatically).

              &forward_merge_excludes=`introtext,image`


                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
              • discuss.answer
                • 51020
                • 670 Posts
                Quote from: BobRay at Nov 09, 2017, 02:16 PM
                AFAIK, getResources doesn't know Symlinks exist.

                You set symlink_merge_fields, but you might try messing with forward_merge_excludes. They default to content, pub_date, unpub_date, richtext, _content, and _processed, which is why your other stuff is not getting through.

                I'm not sure it would work with TVs, but it's worth a try. You should be able to set both symlink_merge_fields and forward_merge_excludes as properties in the getResources tag. The second one should be a comma-separated list of your extra fields (the defaults will be used automatically).

                &forward_merge_excludes=`introtext,image`



                Thanks For this Bob.
                Unfortunately it doesn't work. I tried pdoResources instead but still not working.

                I've just found this on the forums which works like a dream! See below:
                https://forums.modx.com/thread/78156/symlinks-getresources#dis-post-516892

                [ed. note: tm2000 last edited this post 8 years, 10 months ago.]
                  • 3749
                  • 24,544 Posts
                  I'm glad you got it sorted. smiley
                    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