Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Macro expression problem View modes: 
User avatar
Member
Member
tomaszj-dcs - 8/27/2010 4:13:01 AM
   
Macro expression problem
Hi,

why expression macro:
{(1)%currentdocument.nodeowner|(equals){(2)%currentdocument.nodeowner%(2)}%(1)}
always returns False?
But the macro:
{(1)%currentdocument.nodeowner|(equals)84%(1)}
returns True when NodeOwner is 84 and False in other cases.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/31/2010 3:20:44 AM
   
RE:Macro expression problem
Hi,

This will work in version 6.0, where macros will be slightly modified again.

In current version, you can use nested macro to compare it with the result - the macro resolver is called again to resolve the macros in result.

In the above example you are comparing the returned value by the first macro (the node owner ID) to string "{(2)%currentdocument.nodeowner%(2)}" which returns false.

It will work in this way:
{(1)%currentdocument.nodeowner|(equals)84|(truevalue){(2)%currentdocument.nodeowner%(2)}%(1)}

as it is shown in the CTO's blog post.

Best regards,
Juraj Ondrus