I'm dropped a Message Board web part on my page. Set the Name field to be visible so that posted messages will have a name associated with it. I'm prepopulating that field using the macro: {# CMSContext.CurrentUser.UserName #}
What I can't figure out is how to set a readonly attribute on the name input box, or simply hide it all together? Surely this is a very basic functionality. Without doing either, the Name field is entirely editable and users can masquerade as another user when leaving a message. THanks.
I've resorted to using a very fragile CSS selector to hide the name field, since the Kentico generated markup does not contain a robust element ID.
You can simply disable the text control in the \CMSModules\MessageBoards\Controls\Messages\MessageEdit.ascx file:
<cms:CMSTextBox ID="txtUserName" runat="server" EnableViewState="false" MaxLength="250" ProcessMacroSecurity="false" Enabled="false" />
Please, sign in to be able to submit a new answer.