Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dan norcott 21 posts 22 karma points
    May 19, 2009 @ 16:38
    dan norcott
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft