We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49560
    • 28 Posts
    I have a slight problem at the moment, by combining a getResources call and getImageList [[+idx]], [[+_first]] and [[+_last]] arent working as expected:

    Template:
    [[!getResources? 
        &parents=`[[*id]]` 
        &sortby=`publishedon` 
        &sortdir=`DESC` 
        &tpl=`testChunk` 
        &limit=`10` 
        &includeContent=`1` 
        &showHidden=`1` 
        &includeTVs=`1` 
        &processTVs=`1`
    ]]


    testChunk:
    [[!getImageList? 
        &tvname=`testTV` 
        &limit=`4` 
        &tpl=`@CODE: [[+idx]]: [[+text]] ([[+_first]]/[[+_first:is=`1`:then=`first`]])<br/>` 
        &docid=`[[+id]]`
    ]]


    the TV testTVs contain:
    resource1:

    • sample11
    • sample12
    • sample13

    resource2:

    • sample21
    • sample22
    • sample23
    • sample24

    Output:
    1: sample11 (1/ )
    1: sample12 (/ )
    1: sample13 (/ )
    2: sample21 (1/ )
    2: sample22 (/ )
    2: sample23 (/ )
    2: sample24 (/ )

    Expected Output:
    1: sample11 (1/first)
    2: sample12 (/ )
    3: sample13 (/ )
    1: sample21 (1/first)
    2: sample22 (/ )
    3: sample23 (/ )
    4: sample24 (/ )

    Is this a bug or did I do something wrong here?

    This question has been answered by alex.gr. See the first response.

      Alex G - Application Development Apprentice | New MODX User
      codeblick media
    • discuss.answer
      • 49560
      • 28 Posts
      Alright figured it out: The problem was that I'm not allowed to use inline code for that, creating a new chunk for the testChunk getImageList call did the trick

      [[!getImageList? 
          &tvname=`testTV` 
          &limit=`4` 
          &tpl=`newTestChunk` 
          &docid=`[[+id]]`
      ]]
        Alex G - Application Development Apprentice | New MODX User
        codeblick media