XOR

Hello Community,

I'm looking for a XOR-operator in my template code. But fact is, that there was none.

So I have to write my statement with common and/or expressions.

Is there a chance to get the XOR (^) operator into the template code?

I hope to find some supporters.

Best wishes

Diana

6 Comments
Peter_Jodeleit
Crownpeak employee
Crownpeak employee

You mean for numbers??

rbitdd
Occasional Collector

My intenstion are logical comparisons in the if-statement.

$CMS_IF(A && !B || B && !A)$

.. do something ...

$CMS_END_IF$

or in an other writing

$CMS_IF(!(A && B) && (A || B) )$

... do something ...

$CMS_END_IF$

to shorten it to

$CMS_IF(A ^ B)$

... do something ...

$CMS_END_IF$

or something realisable with the same logic.

Peter_Jodeleit
Crownpeak employee
Crownpeak employee

You could use $CMS_IF (A != B)$..do something

rbitdd
Occasional Collector

Okay, I give you a more detailed example:

$CMS_IF(A.empty && !B.empty || B.empty && !A.empty)$

.. do something ...

$CMS_END_IF$

We have to generate CSS-classes into our code, but only if one out of A and B is true. When both are true we have to do something different and also if none of them is true.

We thought an XOR might make our code a little bit clearer. When you are familiar with the function of XOR it is easier/faster to get what the code does, than reading the statements I shew. At least this is my opinion.

rbitdd
Occasional Collector

The longer I think about you suggestion it is not that bad. :smileygrin:

kohlbrecher
Crownpeak employee
Crownpeak employee

Hello Diana

thank you for your idea to improve FirstSpirit. It is important for us to learn from the experiences of our customers and partners. For this reason we appreciate feedback and any suggestion.

We have evaluated the issue once again, but have no plans for a realization in the near future. Therefore, we cannot consider your feature request at this time and I think Peter gave you a good option how to handle this.

You can find more details about our feature selection process in our Features Policy.


Best regards

Jan