Developer forum

Forum » Feature requests » OR operator in If Defined

OR operator in If Defined

Nikki Strømsnes
Reply
It would nice to have an OR operator, so you could check whether or not several tags were defined, and ommit content or show something alternative.

Example:
<!--@If Defined(News:Manchet || News:FirstXChar)-->
    <div class="myStyledBox">
        <!--@News:Manchet--><!--@News:FirstXChar--> &hellip;</p>
    </div>
<!--@EndIf(News:Manchet || News:FirstXChar)-->
Without the OR (||) operator, it will print out a styled textbox and an ellipsis, regardless if there is any text or not. I would rather have, that it didn't print out anything, to make for a cleaner layout. One could also imagine a case, where I wanted to show some alternative content, say "if not this or this, show something different entirelly.

Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer
Good suggestion.

I have it noted to implement these features in the if engine:
  • OR (||)
  • AND (&&)
  • ELSE <!--@Else-->
This would only be part of the new if engine, http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/If-statements.aspx
Votes for this answer: 0
 
Nikki Strømsnes
Reply

Great! :D

 

Cheers. 

 
Martin Nielsen
Reply

Great, Looking forward to this.

 
Kjetil Solberg
Reply
 So when are these features coming?
 
Nikki Strømsnes
Reply
Are these additions still in the pipeline? When can we start using the new if-engine? 
 
Janus Lock
Reply
 Nicolai: ETA?
 
Asger Munkholm Højfeldt
Reply
 Hi there – ETA 27th November in our 8.2 release!

//Asger – Product Manager    
 
Nikki Strømsnes
Reply
Sweet! Thanks for the follow-up.