We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24865
    • 289 Posts
    Hey guys,

    Me and b03tz are developing a site and we’re trying to setup a small getResources in the footer for FAQ items.
    [[!getResources?parents=`8`&includeTVs=`1`&tvFilters=`showHomepage==1`&tpl=`faqFooterItem`&includeContent=`1`&showHidden=`1`]]

    As you can see, nothing thrilling.

    Now, when I print the whole parent folder (thus the children), I can put out [[+tv.showHomepage]] and out of 5, 3 echo "1" and the rest echo’s "". So, I suppose the tvFilter would pick that up, but it doesn’t!

    The TV is available on the frontpage and also in the chunks, so what is going wrong here? Still on MODX 2.0.8pl with getResources 1.3.0.

    Tx in advance.
      @MarkGHErnst

      Developer at Adwise Internetmarketing, the Netherlands.
      • 22303 MODX Staff
      • 10,725 Posts
      FYI, tvFilters and includeTVs are not related in any way. You can use one without the other.

      Can you provide more details about the showHomepage Template Variable? Input type, Input options, Default value, etc.? I cannot reproduce this problem with tvFilters in my tests using what you have provided...
        • 24865
        • 289 Posts
        Sure! My appologies.

        I am using a template variable called showHomepage. It’s a TV that’s placed inside 1 deep category. Lock variable for editing is disabled by default, as is clear cache enabled. The input type is a check box, input option values is empty and the default value is 1. It outputs default as well. Also, it has access over the template I am using it in.

        I reckon this is what you need?
          @MarkGHErnst

          Developer at Adwise Internetmarketing, the Netherlands.
          • 24865
          • 289 Posts
          Well, have you found the bug I’m talking about or is it because we’re using MODX 2.0.8pl?
            @MarkGHErnst

            Developer at Adwise Internetmarketing, the Netherlands.
            • 24865
            • 289 Posts
            I hate to be the one that whines, but the problem hasn’t been fixed yet... This project is due in about 5 days, so there is a a kind of a deadline. I would hate to fix it with some jerry-rigged method.
              @MarkGHErnst

              Developer at Adwise Internetmarketing, the Netherlands.
              • 33976 ☆ A M B ☆
              • 571 Posts
              Hi,

              No solution here, but &debug=`1` might leads you to where it’s failing smiley

              Good luck
                • 24865
                • 289 Posts
                I already tried that fix, it clearly reports (without the filter) all the child resources. It also sees the tvFilter which appears into the array as tv.showHomepage => 1.
                  @MarkGHErnst

                  Developer at Adwise Internetmarketing, the Netherlands.
                  • 33968
                  • 863 Posts
                  Don’t know if it works with TVs, but maybe you could try a ’where’ clause instead of the filter:
                  &where=`{"showHomePage:=":1}`
                  


                  And... sure you have a deadline but I think it’s a bit much getting impatient with OpenGeek to jump and fix something that hasn’t yet proven to be an actual bug. Just saying wink
                    • 24865
                    • 289 Posts
                    That’s why I am not certain it is even a bug, and if I did appear to be getting impatient with OpenGeek, I humbly apologize. smiley

                    I’ll try both fixes, thanks guys. smiley
                      @MarkGHErnst

                      Developer at Adwise Internetmarketing, the Netherlands.
                      • 22303 MODX Staff
                      • 10,725 Posts
                      Make sure you have the latest version of getResources. It should work with default values and resource specific ones. It’s working in my tests at least, so without more details from which I can reproduce the issue, I really don’t know what to tell you. ??