We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38146
    • 6 Posts
    I am attempting 2 separate getResources functions with MODx Revolution and getResources 1.4.2. The first is a simple call to list all resources under the parent. The second is to list all pages with a TV checkbox that has been checked. When attempting to run the snippet, I get a blank page. I have had success with getResources in the past, and am looking for some guidance to why this is not working. Any help would be greatly appreciated.

    Chunk contList:
    <p><strong>[[+pagetitle]]</strong>
    
    [[+tv.memberAddress]]
    
    [[+tv.memberCity]]
    
    P: [[+tv.memberPhone]]
    
    F: [[+tv.memberFax]]
    
    [[+tv.memberCategory]]</p>


    First Resource (trying to list all resources under parent '512'):
    [[!getResources? &parents=`512` &tpl=`contList` &includeTVs=`1` &processTVs=`1` &limit=`0` &sortby=`{"publishedon":"ASC","createdon":"DESC"}`]]


    Second Resource (trying to list all resources with a TV checkbox that has been checked):
    [[!getResources? &parents=`512` &tpl=`contList` &includeTVs=`1` &processTVs=`1` &limit=`0` &tvFilters=`tv.checkboxProduction==1`]]

    [ed. note: mseifert last edited this post 14 years, 9 months ago.]
      • 37582
      • 65 Posts
      Hey mseifert,

      I think most of your example code was stripped from your post. Try using the code-tags.

      Did you use the "includeTVs" and "processTVs" option? Moreover I think you have to use "tvFilters" property.

        • 38146
        • 6 Posts
        Thanks for the quick reply chrisissorry. I updated the post with the code-tags. Any suggestions?
          • 37582
          • 65 Posts
          Is all of it published or do you have to include "showHidden"?
            • 38146
            • 6 Posts
            The pages are published, but hidden from menus.
              • 37582
              • 65 Posts
              Yes, then you have to use it.
                • 22303 MODX Staff
                • 10,725 Posts
                Do not use the tvPrefix when using tvFilters. The prefix is applied only to the placeholders which are available in the tpl's. e.g.

                &tvFilters=`checkboxProduction===1`

                  • 38146
                  • 6 Posts
                  The snippet appeared to work when only one resource had the TV checkbox checked, but once I checked the TV box on more than one resource, it started bringing up the blank page again. The current code:

                  [[!getResources? &parents=`512` &tpl=`contList` &includeTVs=`1` &processTVs=`1` &showHidden=`1` &limit=`0` &tvFilters=`checkboxProduction===1`]]


                  Checkbox:
                  Variable Name: checkboxProduction
                  Input Type: Check Box
                  Input Option Values:
                  True==1

                  Default Value: 0
                  Output Type: Default

                  Any ideas? Any help would be greatly appreciated!
                    • 37582
                    • 65 Posts
                    Why do you use

                    True==1


                    for your checkbox value? I don't really know how to handle TVs as checkboxes. But from a coding point of view I would just write 1 or TRUE.
                      • 38146
                      • 6 Posts
                      Thanks, chrisissorry. Using your suggestion I no longer receive a blank screen, but I still only get one resource result listed.