We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46950
    • 86 Posts
    On a page I put some calls of getResources, one of them looks like this:
    [[!getResources? &tpl=`articleTpl` &parents=`13` &includeContent=`1` &includeTVs=`1`]]
    

    where the chunk articleTpl looks like
    ...
    <a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+longtitle]]</a>
    ...
    


    It shows me the resource exactly how I'd like to see it and the link is 'http://artinox-td.ru/modx/index.php?id=14' (id numbers are different).

    On the same page there is another call of getResources which looks like
    [[!getResources:default=`No results found`? &parents=`13` &includeContent=`1` &includeTVs=`1` 
    &tpl=`@INLINE <BR><a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]] ([[+id]])</a>`]]
    

    It shows me simply a list of links and every link refers to the same place -- 'http://artinox-td.ru/modx/'. I cannot understand why there is no 'index.php?id=...' in these links sad [ed. note: Bruno17 last edited this post 11 years, 10 months ago.]
      • 4172
      • 5,888 Posts
      [[~[[+id]]]]


      This doesn't work with @INLINE, because MODX is trying to make the url, before getResources is running.
      You can use the makeUrl - tag only inside a tpl-chunk, not with @INLINE
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 46950
        • 86 Posts
        Quote from: Bruno17 at Nov 19, 2014, 03:37 AM
        [[~[[+id]]]]


        This doesn't work with @INLINE, because MODX is trying to make the url, before getResources is running.
        You can use the makeUrl - tag only inside a tpl-chunk, not with @INLINE
        So, in INLINE I have to add 'index.php?id=nn' myself?
          • 4172
          • 5,888 Posts
          I wouldn't add 'index.php?id=nn'
          As soon, as you change to FURLs this would not longer work.

          not sure, if this could work with @INLINE:

          [[[[+id:isnot=``:then=`~[[+id]]`]]]]


          But I would just create a chunk and you're done.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 46950
            • 86 Posts
            Quote from: Bruno17 at Nov 19, 2014, 05:12 AM
            I wouldn't add 'index.php?id=nn'
            As soon, as you change to FURLs this would not longer work.

            not sure, if this could work with @INLINE:

            [[[[+id:isnot=``:then=`~[[+id]]`]]]]


            But I would just create a chunk and you're done.
            You see, for me to create a chunk is not a problem, but if it's possible to put a short version of it into INLINE, then it would be logical to expect that the main and necessary features of chunks are supported by INLINE, too. Looks like it's not so and it's quite odd...