-
- 8 Posts
I’m trying to get MODx to perform a seemingly simple task, where getResources makes a filter that includes only those that have a checkbox variable that includes a specific value. I tried tvFilters, but I must be using it incorrectly. Right now, the code I am using returns nothing.
[[getResources? &parents=`0` &tpl=`mainNavItem` &includeTVs=`1` &tvFilters=`inMenu==Main`]]
-
- 8 Posts
Is there any more information I can give to help you give me any advice?
-
- 964 Posts
The only difference with mine is that I am using &includeContent=`1` instead of includeTVs and works fine. This is my filter... &tvFilters=`postFeatured==Home`
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner
-
- 8 Posts
Actually, I think I just figured out what I was doing wrong. It looks like it’s "tvFilter", not "tvFilters"
-
- 964 Posts
This is my call:
[[!getResources? &parents=`7,8,9` &limit=`8` &tvFilters=`postFeatured==Home` &tpl=`resourceList` &includeContent=`1`]]
and it is tvFilters per
http://rtfm.modx.com/display/ADDON/getResources
maybe try it uncached... with the "!"
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner
-
- 8 Posts
Unfortunately, it looks like I was wrong about using "tvFilter". I tricked myself into believing I had solved this. Also, learing the cache does not seem to change things.
So what is the result from your snippet?
-
- 964 Posts
Go to modxperience.com and see the "Featured Howtos" in the home page
or go to secondary pages and see the featured articles in the sidebar.....
with a TV I can indicate per document if I want it featured in Home,
in the sidebar or nowhere (an this can be expanded later). Then I use
getResources to "filter" the appropriate documents...
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner
-
- 8 Posts
I think I really have solved it this time. It appears that settling default values on TV’s does not set it so that it registers with tvFilters. Once I tried the tvFilters value against values that were not default, it worked perfectly. Disabling the default value and returning tvFilter to look for the value I had originally set resulted in a success. This could be an undocumented bug. For now, I will just have to resist setting default values.
Previously, in every case, the snippet would completely fail, and not return anything.