We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23094
    • 59 Posts
    Hi
    I have 6 items in folder (129). If I use &tpl_n4 to break row in my results (3 per row), I got only 4 items.
    When delete this part "&tpl_n4=`tplCloseRow` &tplLast=`tplLastRow`" - I got every 6 items. Why?

    <div class="row">
    [[!getResources:default=`No results found`? &showHidden=`1` &parents=`129`  
     &tpl=`fotografieTpl` &tpl_n4=`tplCloseRow` &tplLast=`tplLastRow` &includeTVs=`1` &processTVs=`1` &includeContent=`1` 
    &debug=`1` &limit=`100` &sortby=`menuindex` &sortDir=`ASC`
    ]]
    


    tplLast
    </div>


    tplCloseRow
    </div>
    <div class="row" style="margin-top: 20px">

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

      • 3749
      • 24,544 Posts
      Every Tpl chunk needs to contain some content (i.e., placeholders). Without placeholders, the Tpl used will only return HTML, which doesn't show on the screen.
        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
        • 23094
        • 59 Posts
        Quote from: BobRay at Nov 25, 2016, 10:29 PM
        Every Tpl chunk needs to contain some content (i.e., placeholders). Without placeholders, the Tpl used will only return HTML, which doesn't show on the screen.

        thanks for reply, but my main &tpl=`fotografieTpl` contains of course content (photo, title, description and others... is too big to put here), and this content is showed when I dont use &tpl_n4 option. My question is, what is wrong with &tpl_n4 / &tplLast / &tplLast? Only when use this options, I see only 4 items instead of 6. It should be 2 rows (3 items per row).
        • discuss.answer
          • 3749
          • 24,544 Posts
          Sorry, I was going by what you posted.

          Do have the &limit property in the getResources tag? It's default value is 5.

          When you do a "view source" when using the extra options is here any evidence of the missing items? Is there any invalid HTML when using those options? It's easy to have that happen when you use multiple Tpl chunks.

          [On second thought] When you use those options, the alternate Tpl is used *instead* of the main Tpl not in addition to it, so they also need to contain the content tags.

            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
            • 23094
            • 59 Posts
            I found problem!
            I thought that main template is always repeated, even if use &tpl_nX, but I need repeat main tpl content in it:

            tplCloseRow
            </div>
            <div class="row" style="margin-top: 20px">
            [[$fotografieTpl]]
            


            Now it works!

            Thank you for your help