Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Hide URL fields on the message board module View modes: 
User avatar
Member
Member
Pasha - 2/4/2013 12:02:53 PM
   
Hide URL fields on the message board module
I added the message board module to a custom document. Since it will be only be visible to authenticated users belonging to a certain role, I have no need for the Name, URL and e-mail fields. What is the most elegant way to hide those fields?

User avatar
Member
Member
kentico_alleng - 2/7/2013 11:13:22 AM
   
RE:Hide URL fields on the message board module

From the design tab of your page, you can simply edit the properties of the message board web part and uncheck the "Show" options for these fields, under the "Form Fields" category.

Regards,

Allen

User avatar
Member
Member
Pasha - 2/7/2013 3:17:09 PM
   
RE:Hide URL fields on the message board module
I do not see "Form Fields". Am I looking at the right screen? http://i.imgur.com/lUCUUvY.png

User avatar
Member
Member
kentico_alleng - 2/11/2013 3:48:38 PM
   
RE:Hide URL fields on the message board module
My apologies.

The approach is different for version 5.x.

You will need to edit the following file:

\CMSModules\MessageBoards\Controls\Messages\MessageEdit.ascx.cs

To remove the fields, you need to hide each field and label, disable the required field validation, remove the error message for the field, and not add the field to a validation group.

For example, to remove the name field, do the following:

1. Within the SetupControls method, add the following lines:

lblUserName.Visible = false;
txtUserName.Visible = false;
rfvUserName.Enabled = false;

2. Comment out these lines:
rfvUserName.ErrorMessage = ResHelper.GetString("board.messageedit.rfvusername");
...
txtUserName.ValidationGroup = valGroup;
rfvUserName.ValidationGroup = valGroup;

The name field should no longer be required.


User avatar
Member
Member
Pasha - 2/14/2013 1:33:18 PM
   
RE:Hide URL fields on the message board module
That did it, thanks!
If, on the other hand, I wanted to add extra fields, should I hack apart the message board web part, or should I create one from scratch?

User avatar
Member
Member
kentico_alleng - 2/19/2013 1:41:50 PM
   
RE:Hide URL fields on the message board module
To customize the fields and behavior, I would recommend modifying a copy of the standard web part.

See the following documentation:

Modifying the Code of Standard Web Parts

Web Part Inheritance

Regards,

Allen