We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51474
    • 27 Posts
    May I know why I can't echo the link `[[~[[+id]]? &scheme=`full`]]` using inline tpl method or getResources?

    [[getResources?
        &parents=`30`
        &limit=`0`
        &showHidden=`1`
        &depth=`0`
        &tpl=`@INLINE <li><a href='[[~[[+id]]? &scheme=`full`]]'>[[+pagetitle]]</a></li>`
    ]]


    when I echo id only, it will come out eg : 31,32,33...

    [[getResources?
        &parents=`30`
        &limit=`0`
        &showHidden=`1`
        &depth=`0`
        &tpl=`@INLINE <li><a href=''>[[+id]]</a></li>`
    ]]


    anyway to echo out the link with ID using getResources with inline method?

    Thankyou!

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

      • 30585
      • 833 Posts
      I suspect this is due to the following caution in the docs:

      It is recommended you use this only when specifying the tpl* properties in a [Property Set], otherwise any placeholders in your inline markup may be evaluated before the content gets passed to getResources, since cacheable nested tags in MODX Revolution are evaluated before processing of the containing tag begins.

      May I ask where you're using this getResources call? Is it in a tpl chunk?
        A MODx Fanatic
        • 51474
        • 27 Posts
        Quote from: treigh at Dec 29, 2015, 06:42 PM
        I suspect this is due to the following caution in the docs:

        It is recommended you use this only when specifying the tpl* properties in a [Property Set], otherwise any placeholders in your inline markup may be evaluated before the content gets passed to getResources, since cacheable nested tags in MODX Revolution are evaluated before processing of the containing tag begins.

        May I ask where you're using this getResources call? Is it in a tpl chunk?
        Yes, I use this in a chunks
        • discuss.answer
          • 4172
          • 5,888 Posts
          I think the MODX-parser tries to parse the makeUrl-tag, before the getResources-snippet is parsed. So the placeholder [[+id]] wasn't set at that time.

          Use a chunk for &tpl, not @INLINE in that situation.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!