ASPX templates
Version 5.x > ASPX templates > MessageBoard viewer and messageboard View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
adam-syndicut - 10/22/2010 8:08:44 AM
   
MessageBoard viewer and messageboard
I have to controls on the page

messageboardviewer - for viewing messages
messageboard - for adding messages

i have it set up so if the user is authenticated it will display the viewer and the board for them to post
if not it just displays the post for that particular article.

The problem i'm having is setting the viewer to only show messages related to that article page that it is on. at the moment if i post in article1 the post will show up in all article pages!!


here is my code


<%@ Register Src="~/CMSWebParts/MessageBoards/MessageBoard.ascx" TagName="MessageBoard" TagPrefix="uc1" %>
<%@ Register Src="~/CMSWebParts/MessageBoards/MessageBoardViewer.ascx" TagName="MessageBoardViewer" TagPrefix="uc1" %>

<div id="comments" style="clear:both; float:left">
<uc1:MessageBoardViewer ID="MessageBoardViewer1" runat="server" Enabled="true" DisplayOnlyApproved="true" ZeroRowsText="No Messages in viewer" TransformationName="Community.Transformations.MessageBoard" AlternatingItemTransformationName="Community.Transformations.MessageBoard"></uc1:MessageBoardViewer>
<uc1:MessageBoard ID="MessageBoard1" BoardModerated="true" runat="server" BoardAccess="AuthenticatedUsers" BoardOpened="true" DisplayToRoles="_authenticated_" BoardRequireEmails="false" BoardEnableSubscriptions="true" ></uc1:MessageBoard>
</div>



protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
dr = CMS.CMSHelper.CMSContext.CurrentDocument.DataRow;

if (!DataHelper.DataSourceIsEmpty(dr))
{
MessageBoard1.BoardDisplayName = dr["Title"].ToString() +"(" + dr["NodeAliasPath"].ToString() + ")";
}
}
}

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 11/2/2010 5:35:03 AM
   
RE:MessageBoard viewer and messageboard
Hi,

You can create some template with message board web part and then set it to be default template for 'article' document type (Default page template in General tab in properties of an Article document type in the Site Manager). Then when new article is created the message board web part will be automatically created on this page and user can add new message board record (posts will be unique for each article).

Best regards,
Ivana Tomanickova

User avatar
Member
Member
dinethnipuna-gmail - 10/25/2013 10:42:07 PM
   
RE:MessageBoard viewer and messageboard
Hi Ivana,

Could you please tell me how to create a template with message board web part. My requirement is to create a custom document type with Message board web part to get separate message to individual document.

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_janh - 10/27/2013 6:11:25 AM
   
RE:MessageBoard viewer and messageboard
Hello,

You can simply follow our documentation where is described how to use the message board as an inline control within a transformation:

http://devnet.kentico.com/docs/devguide/index.html?using_the_inline_abuse_report_web_part_in_transformations.htm

Best regards,
Jan Hermann