How to compare values within the transformation

Customer care manager

Juraj Ondrus asked on October 8, 2009 04:45

How to compare values within the transformation

Correct Answer

Juraj Ondrus answered on October 8, 2009 04:45

For this purpose you can use following expression within your transformation:

<%# (CMS.CMSHelper.CMSContext.CurrentPageInfo.DocumentName.ToString() == Eval("MenuItemName").ToString() ? "curent page" : "not current") %>

It compares current document name with the value in the MenuItemName field. If they are equal the text after "?" sign is returned else you receive the text after ":". Please note it's only example, so you can adjust it to suit your needs.

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.