Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Macro Resolving in transformation View modes: 
User avatar
Member
Member
francis.harvey-irisco - 9/20/2010 4:12:12 PM
   
Macro Resolving in transformation
is it possible to resolve macro in transformation

The problem i have is that some field in database are dupplicated text in different language.

Look at the thing i want to do
<td><%# Eval(MyFunctions.ResolveMacro("{$=Title|fr-ca=Title_fr$}"))%></td>

I use MyFunctions because ResolveMacros doesnt seem to be recognized

The error i got is [CMSAbstractTransformation.DataBind]: Object reference not set to an instance of an object.

ResolveMacros return a string ?
Is this macro can be resolved ?

Maybe it is a syntax error...

Please help
Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 9/21/2010 7:26:32 AM
   
RE:Macro Resolving in transformation
Hello,

First of all, I am not sure why you use two fields for language localizations. You can use the localization macro (http://devnet.kentico.com/docs/devguide/appendix_a___macro_expressions.htm) in Field caption. Then you can see different titles for different languages and use the Eval function simply because you use the Attribute name in the Eval function which is same for all localizations.

Do you have any problems with this solution?

Best regards,
Helena Grulichova

User avatar
Member
Member
francis.harvey-irisco - 9/21/2010 9:52:36 AM
   
RE:Macro Resolving in transformation
Yes you're right

Finally it works, the error was elsewhere

And for now i get each field but i will get only the ones i need for faster execution time, etc...

thanks