Copied to clipboard

Flag this post as spam?

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


  • Dan 1287 posts 3919 karma points c-trib
    Oct 17, 2012 @ 12:45
    Dan
    0

    Content picker that saves parent node ids

    Hi,

    I have quite a simple structure for a site.  Something like this:

    Manufacturers
    - Manufacturer 1
    - Manufacturer 2
    - Manufacturer 3
    etc

    Categories
    - Category 1
    - - Sub-category 1
    - - Sub-cateogry 2
    - - Sub-category 3
    - Category 2
    - - Sub-category 4
    etc

    Products
    - Product 1
    - Product 2
    - Product 3
    etc

     

    Each product has one manufacturer.  So I could list the product nodes under the manufacturers, but I'd rather just have a 'manufacturer picker' property on the products for reasons beyond the scope of this thread (URLs are important, the site design doesn't display the items like this, etc).

    However, the issue I'm having is that I need to relate the products to one or more sub-categories.  This is fine initially - I could use a multi-node tree picker or a relation data-type.  If I did this, on the website it would be very quick/simple to build a 'sub-category' page which lists all of the products for that sub-category, which is what is required.  The issue is that I also need to build a page for 'categories' - to show all products for a particular category.  Since the products are only tagged to sub-categories there's potentially (with several hundred products, each product belonging to several sub-categories) a lot of processing going on in dynamically retrieving all products in a category, from a list of sub-category node ids.

    So, question is, what would be the best way to handle this?  I'm thinking if there was a datatype which stored the node ids of all ancestors of a selected node, that would make the querying more efficient.  Am I overlooking such a datatype (bearing in mind it needs to be able to store multiple sub-categories with their ancestor node ids) or should I just stick to a multi-node tree picker and do the XSLT processing to find the category dynamically from the sub-category ids?

    Any ideas welcome, thanks folks!

Please Sign in or register to post replies

Write your reply to:

Draft