Portal Engine
Version 3.x > Portal Engine > Transformation Expression Help - If Not Empty statement View modes: 
User avatar
Member
Member
jpearce-missouricitytx - 1/12/2009 11:51:22 AM
   
Transformation Expression Help - If Not Empty statement
I am trying to show a seperator in between 2 values and only want to show this seperator if the 2 values are not empty.

How would I go about doing this.

Just to clarify. The | is my seperator and it should show only if both values are not empty. So If both values are not empty it would look like this:

value1 | Value2

If value 1 was empty it would look like this:
value1

If value 2 was empty it would look like this:
value2

How would I write teh code to say show | if both values != ""

Thanks in advance!

User avatar
Kentico Developer
Kentico Developer
kentico_zbysekn - 1/13/2009 7:22:50 AM
   
RE:Transformation Expression Help - If Not Empty statement
Hello,
I think that the best solution is to create own function, which will have two parameters(your two values) and will return empty string or separator(|) according to you needs.
There is a great description of how you can create your own function which will be usable in transformations in developer's guide(http://devnet.kentico.com/docs/devguide/adding_custom_functions_to_tra.htm).

Best Regards,
Zbysek Nemec