I'm trying to make a related products groups loop, and i'd like to filter out some of the groups in the loop.
I have a product that has 3 related groups:
- Variants (GRP1)
- Related products (GRP2)
- You might like (GRP3)
And i don't want to render "Variants" group in my loop. Since my templates have to be highly resuable i dont want to hardcode any group id's into the template, instead i created a custom tag that contains the group i don't want to render.
My snippet looks like this without the If filter, and renders all groups:
<!--@LoopStart(ProductRelatedGroups)--> <div class="featured productlist"> <h6 class="theme gradient"><!--@Ecom:Product:RelatedGroup.Name--></h6> <ul class="productlist rowsview"> <!--@LoopStart(RelatedProducts)--> <!--@Include(../ProductList/item/item.html)--> <!--@LoopEnd(RelatedProducts)--> </ul> </div> <!--@LoopEnd(ProductRelatedGroups)-->
<!--@LoopStart(ProductRelatedGroups)--> <!--@If(Ecom:Product:RelatedGroup.GroupID!='GRP1')--> <div class="featured productlist"> <h6 class="theme gradient"><!--@Ecom:Product:RelatedGroup.Name--></h6> <ul class="productlist rowsview"> <!--@LoopStart(RelatedProducts)--> <!--@Include(../ProductList/item/item.html)--> <!--@LoopEnd(RelatedProducts)--> </ul> </div> <!--@EndIf--> <!--@LoopEnd(ProductRelatedGroups)-->
<!--@LoopStart(ProductRelatedGroups)--> <!--@If(Ecom:Product:RelatedGroup.GroupID!=GetMaster(Co3.RelatedGroupID.I.Dont.Want.To.Render))--> <div class="featured productlist"> <h6 class="theme gradient"><!--@Ecom:Product:RelatedGroup.Name--></h6> <ul class="productlist rowsview"> <!--@LoopStart(RelatedProducts)--> <!--@Include(../ProductList/item/item.html)--> <!--@LoopEnd(RelatedProducts)--> </ul> </div> <!--@EndIf--> <!--@LoopEnd(ProductRelatedGroups)-->
But the last snippet here breaks my site.
Is my snippet wrong, or does @If() not support @GetMaster() yet?
Regards
Martin