Hello everyone I am putting K# in a text filed and kentico is just rendering the macro code. this is the macro i put in {% if (MembershipContext.AuthenticatedUser){return "Welcome"+MembershipContext.AuthenticatedUser.DisplayName;}else{return "Aboutlourm ipsum";} #%} this is what displays
{% if (MembershipContext.AuthenticatedUser){ return " Welcome "+MembershipContext.AuthenticatedUser.DisplayName; }else{ return " About lourm ipsum
"; }
Ideas? Thanks PK
Where did you put it? Transformation? What type?
K# doesn't need return, you can display text + value directly.
{% if (MembershipContext.AuthenticatedUser){ %} Welcome {% MembershipContext.AuthenticatedUser.DisplayName %} {% }else{ %} About lourm ipsum {% } |(identity)GlobalAdministrator%}
I put it in rich text editor attached to a page type. It gave the code option in the tool bar.
Do you use any web part in order to present that field on the page? If so, please make sure it has not "Disable macro" checked in web part settings.
I think I found the issue. I didn't realize the content was being rendered through a repeater. The macro is being rendered through a transformation. I think it's just seeing it as text. Thanks for all your help Paul
Please, sign in to be able to submit a new answer.