We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35385
    • 4 Posts
    This getResources call
    [[!getResources?
    	  	&parents=`[[+id]]`
      		&sortby= RAND()
      		&includeContent=`1`
      		&hideContainers=`0`
      		&tpl=`MainBoxThumbTpl`
      		&showHidden=`0`
      		&depth=`0`
      		&limit=`55`
      		]]
    

    works perfectly on 2.1.1pl
    But it does not in 2.1.2pl (both using getResources 1.3.1), specifically is the `[[+id]]` that doesn’t work.
    N.B.: This is part of a chunk used to template another getResources call.
    If you want to see it http://www.gingyu.com .
    I used this call to build the thumbnails.

    Any advice would be appreciated.
    Thanks
    Ugo
      • 3749
      • 24,544 Posts
      If you want to use the ID of the current resource, it should be [[*id]].

      If you’re setting the [[+id]] placeholder with a property in the chunk tag (or some other way), you might try [[!+id]].
        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
        • 35385
        • 4 Posts
        Thanks for the reply,

        I will try your suggestion of using [[!+id]] I already tested it in 2.1.1 and it works so I will now try in 2.1.2.

        Ugo.
          • 35385
          • 4 Posts
          Unfortunately I can confirm neither [[+id]] or [[!+id]] is working in 2.1.2pl.
          I repeat that in 2.1.1pl both calls work perfectly.
          • I had a similar prob:

            I had this:
            Old code (did not work after 2.1.2-pl):
            [[!getResources? &resources=`[[$settings_page_id]]` &tpl=`chunk_footer_contact` &includeTVs=`1` &processTVs=`1` &tvPrefix=``]]


            Works here now with:
            [[!getResources? &resources=`[[$settings_page_id]]` &tpl=`chunk_footer_contact` &includeTVs=`1` &processTVs=`1` &tvPrefix=`` &parents=`0` &includeContent=`1` &showHidden=`1`]]
              MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
              DESIGNfromWITHIN, MPThemes and Any Screen Size
              Follow me on Twitter | Read my blog | My code on GitHub
              • 35385
              • 4 Posts
              Full original code (NOT Working)
              <div class="intro-panel-thumb-slider">
              	  	[[!getResources?
                		&parents=`[[+id]]`
                		&sortby= RAND()
                		&includeContent=`1`
                		&hideContainers=`0`
                		&tpl=`MainBoxThumbTpl`
                		&showHidden=`0`
                		&depth=`0`
                		&limit=`55`
                		]]
              	</div>
              

              Finally, i found out that by calling the [[+id]] before the getResources call within the div makes everything work again.
              so here the working code:
              <div class="intro-panel-thumb-slider">
                              <<!--This is the code needed to make it work, it's in a a tag to make it invisible the [[+id]] alone wold still make the call work -->
              	  	<a style="display:none">[[+id]]</a> 
                              <<!--Not very elegant indeed-->
              	  	[[!getResources?
                		&parents=`[[+id]]`
                		&sortby= RAND()
                		&includeContent=`1`
                		&hideContainers=`0`
                		&tpl=`MainBoxThumbTpl`
                		&showHidden=`0`
                		&depth=`0`
                		&limit=`55`
                		]]
              	</div>
              

              If anyone have an explanation or a better way to make it work please let me know
              Ugo.
              • In 2.1.2, do not call Snippets or other tags that appear in your getResources tpl using the non-cacheable tag or the processing of that tag will be delayed until after the properties set for each iteration of the Chunk are out of scope. Fixing a bug that was improperly caching non-cacheable tags nested in cacheable tags in 2.1.1 resulted in this unexpected behavior change in 2.1.2.