0
votes

The umbraco website I'm working on has the below structure.

Categories
    Filters
    Batteries
    Brakes
Products
    prod 1
    prod 2
    prod 3
Package Sizes
    Filters
        5 pack
        10 pack
        20 pack
    Batteries
        6 pack
        20 pack

Categories use the category doctype, products the product doctype and package sizes, the package size doctype. The product doctype has a field(ultimate picker) that populates categories, so each product will be related to a category. Similarly, the package sizes also have a field that relates them to categories.

Now, each product has a field called 'package size' which ideally should be a checkbox list and should have the sizes specific to that category. I tried using the 'checkbox tree' datatype in uComponents to list the package sizes but this lists all the package sizes, not the ones specific to this product. It currently looks like this.
Checkbox Tree

What I need is, if the product belongs to category called 'oils', then the package size should only display the nodes from 'oils'.

I would like to know If there is any xPath expression that can do this, something similar to below. Or any other suggestions are appreciated. xPath filter expression

1
Have you tried raising this on the Umbraco forum at our.umbraco.org ?Digbyswift
@Digbyswift Yes, I posted it in the Umbraco forum as well. Thanks.Sparda

1 Answers

0
votes

I think the problem is with your filter. If you are looking to match the "category" of package sizes with the category of your current product, something like this should help:

//packageSize[category=$currentPage/category]/*

I would need to know the specific doctypes for each to be case specific, but "packageSize" would be the doctype of Oils, Filters, Batteries, etc.

The first "category" would be the property found on that packageSize doctype, the rest just relates the query to your current node's category property.