We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50923
    • 137 Posts
    I am trying to filter resouces based on some TV values, with getPage, something like this

    [[!getPage? 
    &elementClass=`modSnippet` 
    &tvFilters=`BrojOsoba==%5%` 
    &element=`getResources` 
    &parents=`-1` 
    &limit=`1` 
    &resources=`2,3,4,5,6,7,8,9,11,111` 
    &pageVarKey=`page` 
    &includeTVs=`1` 
    &includeContent=`1` 
    &tpl=`OffersList`]]


    But the problem is there i always get all results, i need to display only resouces based on tvFilters?
      <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
      • 3749
      • 24,544 Posts
      If your TVs don't have a 'tv.' prefix you also need this:

      &tvPrefix=``


      In addition, I don't think tvFilters (or any other search criteria) are applied when you specify specific resources with &resources.
        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
        • 50923
        • 137 Posts
        Quote from: BobRay at May 07, 2016, 07:47 PM
        If your TVs don't have a 'tv.' prefix you also need this:

        &tvPrefix=``


        In addition, I don't think tvFilters (or any other search criteria) are applied when you specify specific resources with &resources.

        Ok, but i have a list of resources, i need to filter them?
          <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
          • 3749
          • 24,544 Posts
          These are the only solutions that come to mind:

          1) Put them all under a parent or parents and don't use &resources.
          2) Give up getResources and write your own custom search code.

          On second thought, this might work:

          Leave out the &resources property and add this:

          &where=`{"id:IN":[2,3,4,5,6,7,8,9,11,111]}`


          Remember that TVFilters looks only at the raw value of the TV's, and TV values must be explicitly set for each Resource (it can't see default values and won't process @ bindings).

          I'm not sure that the &where property will be used with TVFilters, but I think it will.

          Let us know if it works. smiley
            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