Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Something like leave a comment webpart View modes: 
User avatar
Member
Member
wessel.peeters-ibl-software - 11/25/2013 8:40:06 AM
   
Something like leave a comment webpart
Hello,
I have a custom document type.
I'm looking for a way that users can add comments under this document type.
I found the messageboard but then it will be the same under every document.

So i looking for a way to display a comment form with comments under every document.
Short: something like leave a comment webpart

I hope somebody can help me out.

Best regards,
Wessel

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/26/2013 5:51:21 AM
   
RE:Something like leave a comment webpart
Hello,

The Message board web part is the web part you need since it is document specific, so each document has its own message set.

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 11/26/2013 6:49:02 AM
   
RE:Something like leave a comment webpart
Thanks for responding.
But thats not what i mean.

I have created a custom document type.
Under every unique creation of that document i would like a messageboard with a messageboard viewer.

Now i will have under every creation of that document the same messageboard and messageboard viewer

Like you would have under a article on a webpage with leave a comment.
It is unique for every article.

I hope i am making myself clear.

Best regards,
Wessel

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/26/2013 7:53:12 AM
   
RE:Something like leave a comment webpart
Hello,

Yes, I understood that after your first message and again, you can simply use the message board web part on a default template of your custom document type to have a unique set of comments on each document of that document type.

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 11/26/2013 8:02:18 AM
   
RE:Something like leave a comment webpart
I am sorry the last thing you said was looking helpfull.
Can you maybe describe me a little bit more what to do.
Thank you so far

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/26/2013 9:16:50 AM
   
RE:Something like leave a comment webpart
Hello,

Any document type has the Default page template property where you can choose what template to apply when a new document of that type is created. In your case on this template you can have all necessary web parts you need for rendering the content like the Repeater web part and so on and obviously the Message board web part, so any new document will contain it and your visitors can add comments to this document (and only to this particular document).

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 11/27/2013 6:53:56 AM
   
RE:Something like leave a comment webpart
Thank you its very helpfull, only if i copy the C# code webpart for the contributionlist and messageboard i get the error that er can only be one Control

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/27/2013 6:57:20 AM
   
RE:Something like leave a comment webpart
Hello,

You are in the Portal template section of this forum, so may I ask you what code do you copy and where? A screenshot would be great!

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 11/27/2013 7:31:33 AM
   
RE:Something like leave a comment webpart
Hello Jan,

I have a contributionlist and under it i would like the messageboard.
The idea is that people fill the form and staff can put under the form the solutions.
Screenshot 1 shows the contributionlist that is in "zonetab2"

User image

I was trying your solution by putting the C# code from a messageboard webpart under the zonetab2. As you can see in screenshot 2

User image

Thank you again

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/27/2013 7:45:53 AM
   
RE:Something like leave a comment webpart
Hello,

Ok, first of all the Control language part is already a part of you template (in the greyed header) and the register command needs to be before any content in the layout, but why don't you simply click on that green plus sign you can see on your first screenshot on right side of the zoneTab2 panel and add the Message board web part from the list?

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 11/27/2013 7:58:27 AM
   
RE:Something like leave a comment webpart
Hello Jan,

Because if i put the messageboard in (with the green plus).
It will be the same messageboard under every filled in contribution list.
And i want it to be unique for every filled in contribution.

Hope that helps

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/27/2013 8:09:19 AM
   
RE:Something like leave a comment webpart
Hello,

Oh, ok this is not a template of your target documents right? This is just a page where you can add a new document using the Contribution list web part, so here you don't have to add any Message board web part. The Message board web part needs to be placed on a template of given document type so the target document will contain it, so your visitor can comment it.

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 11/27/2013 8:18:11 AM
   
RE:Something like leave a comment webpart
Yes correct.
I did create a page templates like you said before, with a contributionlist and messageboard webpart copied in the layout.
The layout looks like this:

<%@ Control Language="C#" AutoEventWireup="true" Inherits="IBL_CMSWebParts_UserContributions_ContributionList" CodeFile="~/IBL/CMSWebParts/UserContributions/ContributionList.ascx.cs" %>
<%@ Register Src="~/IBL/CMSModules/Content/Controls/UserContributions/ContributionList.ascx" TagName="ContributionList" TagPrefix="cms" %>
<%@ Register Src="~/CMSModules/Content/Controls/UserContributions/EditForm.ascx" TagName="ContributionEdit" TagPrefix="cms" %>
<%@ Register Src="~/CMSFormControls/Basic/DropDownListControl.ascx" TagName="dropdownlist"
TagPrefix="cms" %>
<%@ Register Src="~/CMSFormControls/Basic/TextBoxControl.ascx" TagName="textbox"
TagPrefix="cms" %>
<%@ Register Src="~/CMSFormControls/Basic/CalendarControl.ascx" TagName="calendar"
TagPrefix="cms" %>
<cms:ContributionList ID="list" runat="server" />

<%@ Control Language="C#" AutoEventWireup="true" Inherits="CMSWebParts_MessageBoards_MessageBoard" CodeFile="~/CMSWebParts/MessageBoards/MessageBoard.ascx.cs" %>
<%@ Register Src="~/CMSModules/MessageBoards/Controls/MessageBoard.ascx" TagName="MessageBoard" TagPrefix="cms" %>

<cms:MessageBoard ID="msgBoard" runat="server" />


Butt then if i look in the design tab i see the following error:
[Error loading the layout]
There can be only one 'control' directive.



User avatar
Kentico Support
Kentico Support
kentico_janh - 11/27/2013 8:24:32 AM
   
RE:Something like leave a comment webpart
Hello,

Please remove all Control lines and move all Register lines together at the top of your layout and after that, please use controls you need.

User avatar
Member
Member
wessel.peeters-ibl-software - 11/28/2013 2:48:15 AM
   
RE:Something like leave a comment webpart
Dear Jan,

I followed the step but then the page is showing nothing.
I found something else that maybe can do the trick for every new invidual page.
I added this code on the layout


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

<cms:MessageBoardViewer ID="MessageBoardViewer1" runat="server" Enabled="true" HideControlForZeroRows="false" DisplayOnlyApproved="true" DisplayToRoles="Registered;Paid" ShowForDocumentTypes="NewsSite.News" ZeroRowsText="No Messages in viewer" TransformationName="Community.Transformations.MessageBoard" AlternatingItemTransformationName="Community.Transformations.MessageBoard"></cms:MessageBoardViewer>
<cms:MessageBoard ID="MessageBoard1" BoardModerated="true" runat="server" BoardUseCaptcha="false" BoardAccess="AllUsers" DisplayToRoles="Paid" BoardOpened="true" BoardRequireEmails="false" BoardEnableSubscriptions="true" ></cms:MessageBoard>


If i can simply put the following where somewhere i think i would work for every invidual page:



MessageBoardViewer1.WhereCondition =
String.Concat("BoardDocumentID = ",
CMSContext.CurrentDocument.DocumentID);



Like this i would go on the id for every unique page.
Where could i put this where statement ?
I hope you could help me with this.

Best regards

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/28/2013 9:03:59 AM
   
RE:Something like leave a comment webpart
Hello,

I am sorry, but I still don't understand why do you need to register it in the layout and why you don't simply add the Message board web part to the default template.

Please, take a look at the screencast I recorded and please let me know what is wrong with recorded approach and what you need differently:

https://kentico.viewscreencasts.com/3efa0d2646ed451c942e19de34321eee

Best regards,
Jan Hermann

User avatar
Member
Member
wessel.peeters-ibl-software - 12/12/2013 7:41:10 AM
   
RE:Something like leave a comment webpart
First thank you for the time and affort you put in the screencast.
Now i understand your solution, the problem is that i want to put a messageboard under a contributionlist unique for the document opent in the contributionlist.

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/23/2013 6:39:59 AM
   
RE:Something like leave a comment webpart
Hello,

Do you mean like you want to have a text box for entering a comment while creating a new document? I mean together with document fields? If so, this won't be that simple since a comment has to be assigned to a document and there is none at that time. Moreover each web part has its own submit button. In this case you would need to develop your own web part or customize the contribution one.

Best regards,
Jan Hermann