We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32678
    • 290 Posts
    I'm trying to filter a list of resources using two tvs. One is a tag tv (articlestags, of the Articles add-on). The second is a radio button tv called featuredNews.

    I want all resources where the articlestags tv value is Current News, and from this list to exclude any where featuredNews has a value of yes (the tv defaults to 'no').

    This works:
    &tvFilters=`articlestags==Current News`

    This doesn't:
    &tvFilters=`articlestags==Current News,featuredNews!==yes`

    Here's the entire call:
    [[pdoResources?
    &parents=`8`
    &depth=`1`
    &where=`{"template:="7}`
    &includeTVs=`pagetitle`
    &tvFilters=`articlestags==Current News`
    &includeContent=`1`
    &showHidden=`1`
    &limit=`5`
    &tpl=`homeAsideItem`
    &sortby=`{"publishedon":"DESC"}`
    ]]


    Any idea why??
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      I'm going to guess the problem is related to your call. Try using something like this:

      &tvFilters=`articlestags==Current News||featuredNews==no`
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 32678
        • 290 Posts
        Quote from: AMDbuilder at Jul 10, 2014, 08:19 PM
        I'm going to guess the problem is related to your call. Try using something like this:

        &tvFilters=`articlestags==Current News||featuredNews==no`

        This would produce: articlestags=current news OR featuredNews=no.

        What I need is articlestags=current news AND featuredNews=no.

        I think it's actually an issue with what appears in the database. Since 'no' is the default value for the featuredNews tv, only those resources where 'yes' is selected actually appear in the database (with the value 'yes') for this tv.

        My assumption was that by excluding these (i.e. !==yes), all resources where yes is NOT selected will get pulled by the pdoResources call.

        But, resources with the default value don't appear in the database for this tv at all, which I guess means that pdoResources has nothing to filter on...???

        I cannot think of a way to work around this... [ed. note: wpicotte last edited this post 12 years, 3 months ago.]
          • 36573
          • 173 Posts
          Don't know if you ever figured this out but in case someone is searching for it here's the solution. the "&includeTVs" needs to the tv that you're calling "articlestags"


          [[pdoResources?
          &parents=`8`
          &depth=`1`
          &where=`{"template:="7}`
          &includeTVs=`articlestags`
          &tvFilters=`articlestags==Current News`
          &includeContent=`1`
          &showHidden=`1`
          &limit=`5`
          &tpl=`homeAsideItem`
          &sortby=`{"publishedon":"DESC"}`
          ]]
            Everything I know I learned on the internet. Saved me thousands in College tuition,