Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Tony Kiernan 278 posts 341 karma points
    Jul 27, 2011 @ 17:12
    Tony Kiernan
    0

    Test up the category tree

    Is there an easy way to test whether a category is a descendent of a specific one without looping through the parent IDs?

  • Christian Wendler 46 posts 155 karma points
    Jul 27, 2011 @ 17:27
    Christian Wendler
    0

    What's wrong with testing parentID == wantedID? Do you have an example what you want to achieve?

    Bye

    Christian

  • Tony Kiernan 278 posts 341 karma points
    Jul 27, 2011 @ 17:34
    Tony Kiernan
    0

    Let's say this

    Company 
    Division 1
    Department
    Team 1
    Employee 1
    Employee 2
    Team 2
    Department 2
    Team 3
    Employee 3
    Employee 4
    Team 4
    Department 3
    Department 4
    Division 2

    I want to be able to tell if any employee, or team or dept is under Division 1.  With the posibility that there may be further levels deeper at a later stage

    Imagine these are product categories as opposed to an obvious compant structure.  I copied it from elsehwere to save time

  • Tony Kiernan 278 posts 341 karma points
    Aug 08, 2011 @ 12:31
    Tony Kiernan
    0

    No-one?  Seriously?

    Is there any way to use DynamicNodeContext?  Get a tree that contains a certain category id and then test if it contains the specified parent?

  • Zac 223 posts 575 karma points
    Aug 12, 2011 @ 12:45
    Zac
    0

    I asked a similar question a while back, and Søren suggested the following.

    I never got around to using it actually (used a horrible parent test mashup thing because I was in a hurry)

    CommerceLibrary:GetRootCategories('myCatalog', boolean('true'))

    I think that gives you the whole structure, perhaps you can get the path to your current category in that whole tree, and then access the relative top level element?

    I'm very hazy when it comes to doing that kind of thing in XSLT.

    If you find a good solution please post it! :)

    Zac

     

Please Sign in or register to post replies

Write your reply to:

Draft