Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Transformation in Macro in Transformation View modes: 
User avatar
Member
Member
lancetek - 10/6/2011 12:56:58 AM
   
Transformation in Macro in Transformation
How can I use values from a transformation in a macro that's inside a transformation? Here's an example transformation or what I'm trying to accomplish:


<li<%# CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("{%currentdocument.nodealiaspath|(tolower)|(contains)<%#Eval("NodeAlias")%>|(truevalue) class='on' |(falsevalue)%}")%>><a href="<%#GetDocumentUrl()%>"><%#Eval("DocumentName")%></a></li>


I'm trying to get the Transformation's NodeAlias into the macro logic - the <%#Eval("NodeAlias")%> paret

User avatar
Member
Member
kentico_michal - 10/6/2011 7:00:43 AM
   
RE:Transformation in Macro in Transformation
Hello,

I would recommend using a custom transformation method instead of using macro expression: Adding custom functions to transformations. You can pass the result of the expression Eval("NodeAlias") to the custom method, compare it to the current NodeAlias and return a value accordingly.


Best regards,
Michal Legen