Each document can only exist in one place. Works a treat. Great.
Now, client belatedly wants docs to exist in multiple categories. I've added an Ultimate Picker control to the documents, so you can select which other subcategories they exist in. That works great from an admin perspective.
I can even get the lists working fine on the subcategory pages - the select looks like this:
select="$currentPage/../../node/node/node[@parentID=$currentPage/@id or contains(concat(',',data[@alias='OtherCategories'],','),concat(',',$currentPage/@id,','))]"
but... I can't think for the life of me how to get it working on the category pages.
The query basically has to say
"Show me all the documents that EITHER have a parent ID that is one of $currentPage's child IDs, OR contain one of $currentPage's child IDs in the comma separated 'OtherCategories' node.
Returning documents containing the ID of a subcategory of the current document :)
God, even saying it's a mouthful.
I have a tree of documents:
Archive
-- Category
---- Subcategory
-------Document
-- Category 2
----- Subcategory 2
--------Document 2
Each document can only exist in one place. Works a treat. Great.
Now, client belatedly wants docs to exist in multiple categories. I've added an Ultimate Picker control to the documents, so you can select which other subcategories they exist in. That works great from an admin perspective.
I can even get the lists working fine on the subcategory pages - the select looks like this:
select="$currentPage/../../node/node/node[@parentID=$currentPage/@id or contains(concat(',',data[@alias='OtherCategories'],','),concat(',',$currentPage/@id,','))]"
but... I can't think for the life of me how to get it working on the category pages.
The query basically has to say
"Show me all the documents that EITHER have a parent ID that is one of $currentPage's child IDs, OR contain one of $currentPage's child IDs in the comma separated 'OtherCategories' node.
Busting my swede a bit. Anyone help?
Cheers!
Dan
is working on a reply...