We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39638
    • 7 Posts
    HI All,

    I need to use a 'start id' that is set as a TV in a specific resource.

    This is the basic call i'm trying to make dynamic:

    [[getResourceField? &id=`298` &field=`longtitle`]]


    It seems that i can not nest another getResourceField to get this working:

    [[getResourceField? &id=`[[!getResourceField? &id=`[[*photoGalleryId]]` &field=`albumStart` &processTV=`1`]]` &field=`longtitle`]]


    I've also tried putting ID collector as a separate chunk which also fails.

    Any ideas?
    • The problem there is that the snippet within the snippet is called uncached ([[!..), while the outer one is cached ([[..).

      What that means is that it will attempt to parse the outer snippet first (because it is cached), while the inner snippet isn't executed until later.. well, making it pointless. I've written about how nested and parsing order works on my blog last year: https://www.markhamstra.com/modx-blog/2011/11/nested-caching-in-modx-revolution/ - that should give you a bit more background on the subject.

      In other words: just call the inner snippet cached and you should be good to go.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 39638
        • 7 Posts
        Hi Mark,

        Thanks for the hint. Oddly, I was sure that I had actually tried both cached and uncached! It's now working and that's what matters.

        Thanks again.