Developer forum

Forum » Feature requests » Advanced if-operators

Advanced if-operators

Jacob Bertelsen
Reply

Hi,

Any thoughts on implementing even more advanced if-operators than these http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/Encoding-extensions.aspx ?

Specifically I am thinking about multiplication, addition, subtraction, division and modulus-operators, so I am able to do something like this:

If(ParagraphContainerSort.Length().Modulus()==0)

add clearfix to every second element

EndIf.

 

The example above can be done in CSS, but not if I want to support IE8, which does not support nth child.


Replies

 
Jacob Bertelsen
Reply

, or am I supposed to do this by using Razor?

 
Nicolai Høeg Pedersen
Reply

Hi Jacob

 

Yes you are :-) (supposed to use Razor).

 

But you can create your own extension methods and create a Modulus method if you want to.

 

BR Nicolai