My macros got changed by the rich text editor

Bo Fu asked on June 5, 2015 22:10


I am trying to use macros in static html web part. First I entered "<a href="{%currentDocument.GetValue("AdvertiseLink1")%}">" when I reopened it became "". It seems the editor automatically changed the content. Any ideas of how to avoid this?


Recent Answers

Ali Heristchian answered on June 7, 2015 08:38 (last edited on December 10, 2019 02:30)

GetValue method has two arguments (column name, default value). Use like this:

{%CurrentDocument.GetValue("AdvertiseLink1", "")|(identity)GlobalAdministrator%}
0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on June 7, 2015 09:40


The Static HTML web part uses WYSIWYG editor that process its input. However if you place your macro in the Source mode and Save the content, it should get resolved correctly on the live site (no matter how it gets rendered in the editor).

I would recommend to use the Static text web part instead, that is the source of the HTML by default.

Best regards,
Jan Hermann

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.