We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • discuss.answer
    • 13428 ☆ A M B ☆
    • 1,031 Posts
    Why not use getResouces for this? No hassle with unpublished/deleted resources, default TV values etc.

    [[getResources?
    &parents=`42`
    &includeTVs=`MyTV`
    &tvFilters=`MyTV!=`
    &totalVar=`totalnotempty`
    ]]
    [[+totalnotempty]]
    
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      um... cause nobody thought of it?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 29076
        • 615 Posts
        Thanks all of you. Jaco posted the sugestion about using getResources to mee at Stackoverflow, and it worked vell:
        [[!getResources? &limit=`1` &parents=`3` &tpl=`countTpl` &includeTVs=`1` &processTVs=`1` &tvPrefix=`` &hideContainers=`1` &tvFilters=`pickedUp!=` &totalVar=`totalnotempty`]]

        and then of cource
        &tvFilters=`pickedUp==`
        if I need to count the empty ones.

        I didn't think about that my self. Thanks again. smiley Now to the next level in this case. I'll try to figure out the solution my self based on your sugestion here. If I can't I'll post the next question in these forum.
          I think, thererfor I am! But what I am, and why...?