Hi all!
Due to a C5 integration the metadata on all products is overwritten every time the import is run. As a workaround to this problem I'm trying to use the "If Defined" and "Include" tags and eCom groupid to include a HTML file that holds the correct Metadata:
<!--@If Defined(Server:Request.groupid)-->
<!--@Include(../../System/Metadata/MetadataSelector.html)-->
<!--@EndIf(Server:Request.groupid)-->
<!--@If Not Defined(Server:Request.groupid)-->
<!--@MetaTags-->
<!--@EndIf(Server:Request.groupid)-->
The file MetadataSelector.html contains a large amout of If statement which the includes the right Metadata:
<!--@If(Server:Request.groupid=Hoevl)--> <!--@Include(../../System/Metadata/Data/Hoevl.html)--> <!--@EndIf-->
<!--@If(Server:Request.groupid=Hoevlj)--> <!--@Include(../../System/Metadata/Data/Hoevlj.html)--> <!--@EndIf-->
<!--@If(Server:Request.groupid=Haand)--> <!--@Include(../../System/Metadata/Data/Haand.html)--> <!--@EndIf-->
<!--@If(Server:Request.groupid=haandpumpe)--> <!--@Include(../../System/Metadata/Data/Haandpumpe.html)--> <!--@EndIf-->
<!--@If(Server:Request.groupid=Kabel)--> <!--@Include(../../System/Metadata/Data/Kabel.html)--> <!--@EndIf-->
<!--@If(Server:Request.groupid=topnoegle)--> <!--@Include(../../System/Metadata/Data/topnoegle.html)--> <!--@EndIf-->
...and it goes on for 300 some linies
I keep getting this error "Include too deep... Make sure the template does not include it self indirectly" - but not all the time.
This one works great! : <!--@If(Server:Request.groupid=Haand)--> <!--@Include(../../System/Metadata/Data/Haand.html)--> <!--@EndIf-->
This one trickers the error: <!--@If(Server:Request.groupid=topnoegle)--> <!--@Include(../../System/Metadata/Data/topnoegle.html)--> <!--@EndIf-->
I can't figurer out why I’m getting this error. I Know that the file I’m trying to include exists and the the file doesn’t include anything else the HTML.
I hope that someone can help me!