This may be a silly question, but I can't figure it out. How do i get all products and not the featured products? How should the foreach statement look like? While still using the models builder ofc.
Assuming this is your products page and all your products sit below it as children with no other types of document you could use this:
foreach(Product product in Model.Content.Children().Select(p => new Product (p)))
{
//Markup required
}
Models Builder only know's the properties that belong to that specific piece of content. You have to perform additional logic away from the Model or adjust the model to match your needs.
Models Builder (PureLive)
Hey Guys,
This may be a silly question, but I can't figure it out. How do i get all products and not the featured products? How should the foreach statement look like? While still using the models builder ofc.
Hi Jeppe,
Assuming this is your products page and all your products sit below it as children with no other types of document you could use this:
Models Builder only know's the properties that belong to that specific piece of content. You have to perform additional logic away from the Model or adjust the model to match your needs.
Hope this helps,
Paul
is working on a reply...