Hello folks,
Maybe I’m just not thinking far enough but I’m wondering if someone has a smart solution for my problem.
I use lots of different TVs (like language, country, institute, year, author, etc.) in my documents and would like to apply user generated filters to them to get only the resources I’m looking for. Of course, I thought about using getResources with the tvFilters option. A function would then generate the corresponing tvFilters string out of the arguments set by the user. It looks like brackets aren’t currently supported in the getResources snippet. So, the example below doesn’t really work:
[[!getResources? &parents=6 &includeTVs=1 &tpl=defaultView &tvFilters=`language==English,(country==DE||country==UK||country==FR)`]]
I know that in this specific example I could arrange them in a different way by adding the `language==English` with an AND before or after every `country==XX` to get the correct result. But this gets quite complicated if I need to filter for even more TVs than just these two. For example, the following SQL pseudo code would result in an very, very long tvFilters string and I don’t even know if it would work:
SELECT resource FROM myResources WHERE lanuage = English AND (country = DE OR country = UK) AND (year BETWEEN 2008 AND 2010) AND (author = Bill OR author = James)
So, any ideas? Or is there a way to implement such a functionality with xPDO querys?
Thanks for hints and suggestions,
Lukas