Developer forum

Forum » Templates » If statement not being replaced by Dynamicweb

If statement not being replaced by Dynamicweb

Lars Larsen
Reply
Hey,
In a productlist template I have this if statement:
    <!--@If Defined(Ecom:Group.ID)-->....do some output......<!--@EndIf-->

It all seems pretty straight forward, but Dynamicweb does not replace the if statement. It seems like Dynamicweb does not interprete my if statement at all!
What am I doing wrong?? I am using Dynamicweb v. 19.2.0.2.

Replies

 
Nicolai Høeg Pedersen
Reply
Your endif statement is wrong. When using if defined you have to do like this:
<!--@If Defined(Ecom:Group.ID)-->....do some output......<!--@EndIf(Ecom:Group.ID)-->
http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/If-Defined-tags.aspx

If using the new if statements, use the endif that you wrote.
 
Lars Larsen
Reply

Oh, yes your are right. I think I got that wrong because I started out using the new if statement. My original code looks something like this:
<!--@If(FinansieringsType='AMU')-->...do some code...<!--@EndIf-->

But I can not make it work! I have a DwTemplateTag just before the if statement and in the tag list I can see my tag "FinansieringsType". So I really don't understand why I can't make it work :-S


 
Nicolai Høeg Pedersen
Reply
Let us see the template...
 
Lars Larsen
Reply

Here is my template. The if statement is in line 102. Could the problem be that I set the tag FinansieringsType in a ProductListTemplateExtender?
 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
19.2.0.2 does not support if in templates. Only if defined.
Votes for this answer: 0

 

You must be logged in to post in the forum