The simple way to pass values to your snippet is via the input parameters (sorry to be pedantic, but hey, it’s a forum post so even if it’s stuff you already know, maybe someone else is watching):
Call your snippet and pass it a value something like this:
[[!mySnippet? &my_argument=`[[*my_tv]]` ]]
But you could also calculate what the TV value is just by knowing page ID by using the xPDO API. I know Bob has some examples of this on his site if you need them (sorry, I’m being lazy here).
I was having some trouble using TV filtering in the
getResources snippet, but you should be able to do searches by TV variables using establish Snippets.
Thirdly, if you are rolling your own Snippet, I’ve found the getCollectionGraph method to be extremely useful for this type of thing... it lets you join on other tables and search them using the normal xPDO where condition. I have a problem on a site where I need to join on TV values programatically and I’ll post my methods in the official docs once I figure them out...
Wow... I must be tired... my response went from MODx 101 to some advanced dev stuff... not sure what level of response you’re after. Can you clarify more of what direction you’re proceeding in so the forum dudes can offer more info?