- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 10:49 AM
For Knowledge v3; how can I display/show the comments box, yet hide previous user comments from non-knowledge_admins? We want all users to be able to submit comments on an article, however we only want knowledge_admins to be able to view those comments once submitted.
The following knowledge property will either show the comment box and user comments or nothing at all if you dont have the knowledge_admin role.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2016 05:11 AM
Comments controlled by UI Macro kb_view_feedback:
The code that displays the actual comments is this portion:
<div id="comments_section" class="snc-comments-section" style="display:$[displayFeedbackOn];">
<j:while test="${feedbackRecords.next()}">
<div class="snc-kb-comment">
<div class="snc-kb-comment-by">
<img src="images/icons/feedback.gifx" alt="${gs.getMessage('Feedback')}" />
<span class="snc-kb-comment-by-title">$[SP]${gs.getMessage("Posted by")}</span>
<span class="snc-kb-comment-by-user">$[SP]${HTML:feedbackRecords.user.getDisplayValue()}</span>
<span class="snc-kb-comment-by-title">$[SP]${gs.getMessage("on")} </span>
<span class="snc-kb-comment-by-date">$[SP]${feedbackRecords.sys_created_on.getDisplayValue()}</span>
</div>
<div class="snc-kb-comment-by-text"><g2:no_escape>${HTML:kbViewInfo.getFeedbackComment(feedbackRecords)}</g2:no_escape></div>
</div>
</j:while>
</div>
Added condition to check if user does not have knowledge_admin role, then display no comments.
The line immediately following that portion, <g:inline template="kb_view_feedback_entry" /> is what controls the "Leave a comment..." comment entry portion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 08:21 AM
Yes, however I did not add a condition to check for roles. Rather I updated
kbViewInfo.feedbackInitialDisplay = true; from false to true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 12:51 AM
Hi Billi,
I was requested to do the same setting. I am not so familiar with the jelly script. How do you include the kbViewInfo.feedbackInitialDisplay = true; in the UI Macros? And then, did you delete the line <g:inline template="kb_view_feedback_entry" /> ?
Thank you in advance
MR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 05:13 AM
Originally it was line 6 of the UI Macro that I had changed from true to false "kbViewInfo.feedbackInitialDisplay = true;" . I didn't like how that worked in v3 as the user never receives a confirmation message that they submitted a comment. I found a better solution without modifying the macro.
Update the KB Properties to show comments when article loads, list of role leave empty and change the Max number of user comments to display to 0. Then the user can only view their comment their entered and no other comments. The KB admins can view all comments submitted from the article when in Edit more, the Feedback module or by receiving an email. Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2016 06:56 AM
Hi Billi,
Thank you for your feedback and for your help. Now it's work!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2016 01:47 PM