Nested Collection List (or a workaround)

Hi there all,

I wonder if someone can help me please as I am having a mental block.

I have a page where I require a dynamic collection within another dynamic collection. Example: -

  • [PRODUCT] - Product Collection
    – Name
    – Description
    – [PRICE] - Price Collection
    – [PRICE] - Price Collection
    – [PRICE] - Price Collection

‘Price’ is also a collection with a reference to the specific product it relates to. I know I cannot currently nest dynamic collections within each other but does anyone know of a work around?

Thanks for any assistance you can provide.

Many Thanks,
Jamie

What fields are in the “Price” collection? Why can’t they just be numeric price fields in the product?

Maybe ‘Price’ collection was the wrong thing to call it. They’re more like Variants of the product.

One product may have only 1 price/variant, another product may have 2 prices/variants.

What fields are in the “Variants” collection?

Apologies, you did ask that originally.

Name,
Price,
Description,
Product (Reference field)

If you can put all the variant description in a single richtext field, then you could potentially do this if you have a few variants:

Screenshot_2017-10-03_221002

Otherwise, you will need to have a “default” or “primary” price field in the product itself (to display in a collection list of products). Then in the Product template page, you can have a collection list to display variants.

Thank you.

I think I will go down the route of your first approach as there won’t be any product detail pages to then list the variants on.

Here is an example layout: https://www.woodlandlogs.com/prices

Actually, since you only have a few products, you can do away with the CMS and just design the products directly onto a single page like what you are doing now.

A good use for CMS is if you/your client is going to be regularly adding/removing products, and requiring a template page to display a lot of details about a single product (specifications, extra images (slider/lightbox), related products). Otherwise a CMS is overkill here.

As I understand it this is related to a similar problem I posted a while back. There is no good way to do this in the CMS today. A list or table field in the CMS system would be very handy. I have requested it on the wishlist here

Christoffer

I completely agree. The example link I gave is just designed on the page, the reason for converting it to CMS is because the client now wants to have control over what products show and what the price variants of those products are.

I could keep it as is and just make the changes for them (adding/removing products/prices) but that’s not ideal for me.

I think I will just move the variants into the products collection like you suggested and then use conditions to show/hide when they’re being used.

1 Like

Thanks @Christoffer I have upvoted this wishlist request.

I’m facing this issue right now. I need to create a course curriculum collection which requires sections and modules. The sections have multiple modules and I need to iterate through the sections and the modules to show under a specific course. This isn’t ideal right now… can’t actually do it.

@crjoe Yes, you can do it if the Sections and Module collections use a Reference field ( not Multi-Ref ) to connect with your Course.

Here’s a walkthrough if you face this challenge again;

1 Like