I’m trying to figure out how to retrieve a single child resource cross-referencing a template variable. I have a date field as a template variable and I’d like to be able to get the resource data and template variables for the single entry.
I’ve smacked my head against the wall too much over the last two days.
The getResources snippet gets me really close but the tvFilters var only compares for "LIKE" in the SQL query. I want to be able to find the entry with something like `date >= $date_var` so it will ignore entries with a date before the $date_var. Obviously I could create a snippet that retrieved every resource using getResources sorted by tv.date but then I’d have to loop through every retrieved resource to find the first entry greater than the $date_var. That just seems like a waste of server resources, thus I’m here!
Any help would be greatly appreciated, I’ve been working with MODx for the last week and would love to figure this out.
In case it matters, I’m using Revolution v2.0.4-pl2
Thanks in advance!