modxmodx-revolutionmodx-resources

How to display resources in modx with a specific TV


I'm trying to use getResources to only show the resources with a certain type of template variable. I know I'm doing something wrong b/c the page is displaying all template vars:

[[!getResources? 
&parent=`[[*id]]` 
&showHidden=`1` 
&limit=`0` 
&tpl=`Dining Section` 
&includeContent=`1` 
&includeTVs=`1` 
&processTVs=`1` 
&tvPrefix=`` 
&tvFilters=`Dining Section Title != ''`]]

In the last argument I am trying to only display resources with the TV "Dining Section Title". Any help would be appreciated.


Solution

  • I solved it. I needed to remove the single quotes from the tvFilters value.

    [[!getResources? 
      &parent=`[[*id]]` 
      &showHidden=`1` 
      &limit=`0` 
      &tpl=`Dining Section` 
      &includeContent=`1` 
      &includeTVs=`1` 
      &processTVs=`1` 
      &tvPrefix=`` 
      &tvFilters=`Dining Section Title!=`
    ]]
    

    Thanks okyanet for the help.