I have a smart search filter that is filtering news items by tags which all works fine.
The query for the filter dropdown is as follows: SELECT 'DocumentTags', TagName, TagName FROM CMS_Tag WHERE ##WHERE## ORDER BY ##ORDERBY##
SELECT 'DocumentTags', TagName, TagName FROM CMS_Tag WHERE ##WHERE## ORDER BY ##ORDERBY##
I need to know how to add a default of "All" (essesntially no filter) to this list, but cannot work out how to do it.
The only option I have currently is to tag all documents with "All" tag then this would show up, but hopefully there is another way?
I got the answer from stack overflow:
SELECT '','','All' UNION SELECT 'DocumentTags', TagName, TagName FROM CMS_Tag WHERE ##WHERE## ORDER BY ##ORDERBY##
Update your query to use a UNION
SELECT 'DocumentTags', 'All', 'All' UNION SELECT 'DocumentTags', TagName, TagName FROM CMS_Tag WHERE ##WHERE## ORDER BY ##ORDERBY##
Thanks Brenden, It now has the option All in the list, but it doesn't return any results when it should be returning everything.
Do you know what I am doing wrong?
Please, sign in to be able to submit a new answer.