The listing should look exactly the same as the actual listing on the listing page, so using the same template is actually ok if that is possible.
Is there a good way to do this?
Right now I am doing like this:
public class MyProductTemplateExtender : ProductTemplateExtender{ public override void ExtendTemplate(Dynamicweb.Rendering.Template template) { ProductCollection combined = new ProductCollection(); foreach (Group asgrp in Product.Groups) { if (asgrp.Products.Count>0) combined.AddRange(asgrp.Products, false); } Dynamicweb.Rendering.Template looptemp = template.GetLoop("testloop"); if (looptemp!=null) { foreach (Product pr in combined) { looptemp.SetTag("temp", pr.Name); looptemp.CommitLoop(); } } } }
Is there some better way to include such a listing?
Can I perhaps somehow use the function looptemp.SetTags(DataRow)? Is it possible to get the product's datarow and make DW automatically create all the usual tags based on that datarow for a given product?