We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    This seems to work

    [[!getResources? &parents=`118` &tpl=`TPL` &includeTVs=`1` &limit=`1` &sortby=`RAND()` &tvFilters=`LeaderboardImg==%`]] 


    note the % in the tvFilters param




    Hi,

    Can anyone help with filtering empty TVs with getResources?

    So far I tried


    [[!getResources? &parents=`118` &tpl=`TPL` &includeTVs=`1` &limit=`1` &sortby=`RAND()` &tvFilters=`LeaderboardImg==''`]]
    [[!getResources? &parents=`118` &tpl=`TPL` &includeTVs=`1` &limit=`1` &sortby=`RAND()` &tvFilters=`LeaderboardImg==`]]


    Looking at the code it might not be possible

     $conditions[$filterGroup][] = "EXISTS (SELECT 1 FROM {$tmplVarResourceTbl} `tvr` JOIN {$tmplVarTbl} `tv` ON `tvr`.`value` LIKE {$tvValue} AND `tv`.`name` = {$tvName} AND `tv`.`id` = `tvr`.`tmplvarid` WHERE `tvr`.`contentid` = `modResource`.`id`)";



    I’m trying to display a random image TV.

    Thank you.
      • 29860
      • 59 Posts
      thanks for that! Was very handy!