I would like to create a custom loop in my template. What I have done is:
I created product variants in DynamicWeb eCom, for each variant I have selected an image. On my productlist page, I would like to be able to show these images using template tags (loop), so I created a class which inherits from the ProductListExtender. In this class I created the following code:
VariantOptionCollection voc;
TagCollection tc;
Loop voLoop;
voc = VariantOption.getVariantOptions("VARGRP1");
voLoop = new Loop();
voLoop.Name = "VariantImages";
foreach (VariantOption vo in voc)
{
tc = new TagCollection();
tc.Add(new Tag("VariantID", vo.ID));
tc.Add(new Tag("VariantImage", vo.ImgSmall));
voLoop.Tags.Add(tc);
}
Template.Loops.Add(voLoop);
base.ExtendTemplate(Template);
When I output the available tags (DwTemplateTags) I can see there is a loop available with the name VariantImages.
When I output the available tags within that loop, I don't get any results. When debugging, I can see the loop is filled with tags, but they are not abailable in the template.
Has anybody got any idea what I am doing wrong to create a custom loop?
Thanks in advance,
Jan Michiel Bruijn