Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Jan 21, 2010 @ 00:33
    Tom
    0

    List Products In One or More Categories

    Hi All,

    We already use umbraco for smaller projects here and I'm thinking of using umbraco for a project that is not ecommerce enabled but has a list of products in one or more categories with a detailed information page but no cart or checkout etc.. it's really informational and used to present a range of products.

    I was thinking of 2 approaches and was wondering what other people had done in the past or could suggest!

    1. have a sql db with the products in it and product category joins then SOMEHOW? (not sure how to do this in umbraco) create a user control and have it retrieve the products in the cs file and populate a paginated repeater (but then the question I have is how could the user administer the products/categories etc in umbraco if thats possible?)

     

    2. Use a document type of product which has a checkbox list of categories or multiple content picker to allow me to select categories then use xslt for pagination

     

    any comments, thoughts, alternative approaches etc?

    Thanks,

    Tom

  • Harald Ulriksen 207 posts 249 karma points
    Jan 21, 2010 @ 07:20
    Harald Ulriksen
    0

    Hi Tom,

    if you decide to keep this in SQL you will need to make an admin for it unless that's already inplace. To view products and categories you can write an xslt extension. This is basically a static class with static methods in it. The methods should return a single value or XPathNodeIterator, the XPathNodeIterator is fairly simple to get if you have a dataset or xml document. However, this will hit your sql server on each view so keep performance/caching in mind.

    Using a document type of product you can then store categories using tags datatype, but if you need more than just a name for each category - let's say some picture and a category description, you can make a document type for category and then use the Tribal Xpath node relations package, it's ace.

    I'm using the document type aproach for a similar setup categorizing travel packages, such as adventure/city/summer etc.

    Hth,
    Harald

     

  • Tom 713 posts 954 karma points
    Feb 11, 2010 @ 02:43
    Tom
    0

    Hi Harald,

    to do adventure/city/summer etc do you have the category doc type and are usign tribal xpath node relations?

  • Harald Ulriksen 207 posts 249 karma points
    Feb 12, 2010 @ 11:16
    Harald Ulriksen
    0

    Yes, exactly.

    This is how I have configured our tribal xpath node relations datatype for this. As you see from the xpath statement I need to pick destinations categories from various places, there's three different expressions to get all the categories show in the list.

     

    //node[@id=$currentNodeId]/ancestor::node[@nodeTypeAlias="destinationToplevel"]/node[@nodeTypeAlias="destinationCategory"] | //node[@id=$currentNodeId]/preceding-sibling::node[@nodeTypeAlias="destinationCategory"] | //node[@id=$currentNodeId]/following-sibling::node[@nodeTypeAlias="destinationCategory"]


     Harald :-) 


     

Please Sign in or register to post replies

Write your reply to:

Draft