Portal Engine
Version 3.x > Portal Engine > Adding Logic to a ASCX transformation View modes: 
User avatar
Member
Member
jonathanchauncey-fdle.state.fl - 9/29/2008 1:35:15 PM
   
Adding Logic to a ASCX transformation
I would like to do some simple if statements within a transformation for a custom document I have created.

I see you have IfEmpty() but what I really need to do is test if a boolean is either true or false.

like this -

if(Eval("arrested"), "You are arrested", "You are not arrested")

is this possible? An example would be great.


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/30/2008 3:15:02 AM
   
RE:Adding Logic to a ASCX transformation
Hi,

Could you please try to use IfCompare command? The definition is:

IfCompare(object value, object comparableValue, object falseResult, object trueResult)


This is not listed in the examples since it is not used very often. I hope it will help.


Best Regards,
Juraj Ondrus

User avatar
Member
Member
jonathanchauncey-fdle.state.fl - 9/30/2008 8:04:34 AM
   
RE:Adding Logic to a ASCX transformation
it would be helpful if you guys published a help document on transformations and everything you can within a transformation.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/30/2008 8:59:00 AM
   
RE:Adding Logic to a ASCX transformation
Hi again,

You can find many information in our API documentation in CMS.Controls -> CMSAbstractTransformation class (http://devnet.kentico.com/downloads/kenticocms_api.zip). Not all methods are listed. You can also take a look in the Visual Studio using View -> Object browser.

You can also add custom function to transformations - http://www.kentico.com/docs/devguide/adding_custom_functions_to_tra.htm


Best Regards,
Juraj Ondrus