Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Macros View modes: 
User avatar
Member
Member
luyolo.mhlauli-nmmu.ac - 9/19/2011 5:07:06 AM
   
Macros
I've got a web part that displays HTML links using context macros and a custom macro in its Text property.

THESE WORK
<p><a href="/Kentico/Groups/{%CommunityContext.CurrentGroup.GroupName%}">Pages</a> <br />

The context macros work fine but when it comes to my custom macros it goes through the code and brings back the result of my macro but somehow it gets lost along the way and that link becomes a blank href .

<a href="">Pages</a><br />

Can anyone assist please

User avatar
Member
Member
kentico_michal - 9/19/2011 5:37:53 AM
   
RE:Macros
Hello,

Could you please make sure that you set the match property of boolean type to true in the code of the custom macro, for example:


switch (expression.ToLower())
{
case "currenttime":
// match needs to be set to true
match = true;
result = DateTime.Now.ToString();
break;
}
return result;
}


If it does not help, could you please post here the code of the custom macro? Thank you.


Best regards,
Michal Legen