Yes Jan - this is exactly what I was thinking about as well. I am not familiar with the ArcheTypeModel, but since it appears that the return type is enumerable, something like this should work.
@{
var left = fieldset.GetValue<ArchetypeModel>("leftproducts");
var right = fieldset.GetValue<ArchetypeModel>("rightproducts");
var allProducts = left.Concat(right).ToList();
foreach(var nestedFs in allProducts){
<p>stuff</p>
}
}
You can use Union or Concat, the former removes duplicates, the later doesn't
Foreach with multiple sources
How do i join two sources in a single foreach statement?
So instead of:
I would have something like
Hi Claus
I'm not 100% certain but perhaps you can find some inspiration in the answers from Dennis in this post? http://our.umbraco.org/forum/developers/razor/59560-How-to-merge-two-NodebyID-into-one-variable?p=0
/Jan
Yes Jan - this is exactly what I was thinking about as well. I am not familiar with the ArcheTypeModel, but since it appears that the return type is enumerable, something like this should work.
You can use Union or Concat, the former removes duplicates, the later doesn't
-Roger
Perfect :)
is working on a reply...