Copied to clipboard

Flag this post as spam?

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


  • Heather 13 posts 125 karma points
    Jun 10, 2020 @ 19:34
    Heather
    0

    I have really never had content nested more than two levels.

    I have 3 Document Type Collections.

    1. Product Categories
    2. Product Sub Categories
    3. Product Items

    Basically I want to be able to have a certain URL path.

    I created a page called Products and on it I display the possible categories.
    (/products)

    When they select a product category I want it to show the possible SUB categories. (/products/appliances)

    Finally I want them to select a sub category and then display all the product Items (/products/appliances/dishwashers)

    I know this maybe a super silly question, but how do I create something like this? I basically want to preserve this URL structure so I am not using query strings.

  • Amir Khan 1282 posts 2739 karma points
    Jun 10, 2020 @ 21:02
    Amir Khan
    1

    You probably want to use actual nodes / subnodes for this as nested content is really meant to render content on one template and not generate URLs. Nested content is meant as a set of building blocks to render things on one page.

    So you'd create a document type / template for each of these: Product Categories Product Sub Categories Product Items

    And then create nested nodes in the content trees. There are lots of different ways to set that up but that's the most straight forward.

  • Heather 13 posts 125 karma points
    Jun 11, 2020 @ 14:34
    Heather
    0

    Thank you so much for the reply. I will give these suggestions a try

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Jun 10, 2020 @ 21:35
    Nik
    101

    Hi Heather,

    In the Umbraco back office you probably need 4 document types.

    1. Products
    2. Product Category
    3. Product Sub Category
    4. Product

    Then, on Products, go to Permissions tab when configuring your doc type and allow Product Category type to be created under it. Then on your Product Category, go to the Permissions tab and allow Product Sub Category to be created underneath it. Finally on the Product Sub Category allow the Product type to be created under it.

    This will allow you the following creation in your content tree:

    Products

    Category A

    Sub Category A

    Product A

    Which would have the url /products/category-a/sub-category-a/product-a

    Which I believe is what you are after?

    Hope that makes sense.

    Nik

  • Heather 13 posts 125 karma points
    Jun 11, 2020 @ 14:37
    Heather
    1

    Thank you so much for the help!

  • Yakov Lebski 554 posts 2118 karma points
    Jun 11, 2020 @ 03:41
    Yakov Lebski
    2

    this is right in case that you allow product to be only in one category, when you need product to be in multiple categories it should be managed in different way

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Jun 11, 2020 @ 09:10
    Steve Morgan
    2

    My ten pence on this.

    I've previously done this by using a "dummy product" node. This just has a picker to the actual product but sits in the secondary sub category and renders the product under this node path as well.

    That way you can put a canonical on the dummy product which is under it's secondary (third / fourth...) paths back to the "original" so you're not displaying duplicate content but still have this product surface in searches / lists in multiple places.

    The editor just has to update descriptions and prices in one place still and it also allows the editors to see what products are where more visually IMHO - keeping the content tree rather than having a flatter structure with category pickers.

    But - it always depends on the requirements of the customer - there's no definitive solution / answer and that's why we like Umbraco... right?

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Jun 11, 2020 @ 09:58
    Nik
    2

    I've done this as well, it all depends on the use case :-D (infact I'm doing something very similar on a site right now as it happens)

  • Heather 13 posts 125 karma points
    Jun 11, 2020 @ 14:44
    Heather
    0

    Steve, yes there is so much flexibility and for a newbie that can be overwhelming at times. Thanks so much for you suggestions.

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Jun 11, 2020 @ 15:34
    Ault Nathanielsz
    0

    So Steve, if a product belongs in 3 sub categories, you have 2 "dummy" nodes and one "real" node in the most useful category? (Or 3 dummies and the real one as a child of "products"?)

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Jun 12, 2020 @ 09:28
    Steve Morgan
    2

    Yes - your first example. For the particular shop I was doing the product naturally belonged in one category and they wanted it to appear in 1,2, 3 + others so they create the "master" product first and then add it to other categories with the "product link" doc type that just picks the master. I colour them differently (blue is a dummy, black is primary) so it's nice and obvious.

    enter image description here

    That way the dummies all have a canonical tag to /products/primarycategory/someproduct/

    Rather than breaking the Umbraco model of the content tree reflecting the URL (ie. dumping products all in some content container elsewhere).

    I find it much easier (and hope it's therefore easier for the Editors) to always "know" where a content node is based on it's URLs and keep from overriding this logic to a minimum but based on some of the solutions I inherit I'm possibly in the minority!

Please Sign in or register to post replies

Write your reply to:

Draft