- Updating from an older version
- How to install
- Configuration options
- attachments
- attachmentSizeLimit
- allCommentsMustBeApproved
- approverEmail
- approvalEmail
- authorCanEdit
- autoSubscribeToRootComments
- categoryEnabled
- categoryFIN
- categories
- categoriesUserDefined
- categoryMandatory
- colorMyComments
- commentFIN
- configListName
- configListBaseUrl
- configListHidden
- containerWidth
- dateFormat
- footerRowTemplateOverride
- footerRowVisible
- headerRowTemplateOverride
- iconsHorizontal
- moderatorGroupIDorUserID
- moveCommentGroupName
- moveCommentThreadIdArr
- multiInstanceMode
- newTopicButtonPosition
- pageSize
- placeholderID
- replyLevels
- restrictWriteAccessToGroups
- richTextInputUsingTinyMCE
- searchEnabled
- searchStringMinLength
- showCategoryInComment
- showCommentLink
- showCatagoryFilter
- showLikeButton
- showDislikeButton
- showProfileImage
- showTopicCount
- showTopicInComment
- showUserEmail
- sortAscending
- subscriptionEnabled
- subscriptionEmail
- textareaHeight
- textareaVisible
- threadID
- threadIDTrimmed
- threadIDFIN
- threadInitiallyCollapsed
- timeZoneCorrection
- tinyMCE_Language
- topicEnabled
- topicFIN
- topicMandatory
- Intercepting adding or updating of comments
- Email construction variables
- Questions and feedback
Last updated: May 05, 2021.
This version of CommentBox for SharePoint requires SharePoint v2013 / 2016 / Online. You find an older version here.
Updating from an older version
Most of the settings have changed in this new version, and to update an existing version of cBox you must go trough all settings in the file spjs-cBox_CEWP.html the parameters for configListName and configListBaseUrl replicates the parameters from your existing version. The configListName parameter had a default value of SPJS-CommentBox.
How to install
- Download the files from here. This package includes all files necessary for setting up the solution.
- Unzip the file and upload all the files to a document library named SPJS where you want to use the solution. The contents of your /SPJS/cBox/ folder should be like this:
folder: css
folder: js
folder: tinymce
folder: tinymce_ie
file: spjs-cBox_CEWP.html - Go back to your local download folder and open the file spjs-cBox_CEWP.html and correct all the <link> and <script> tags so that they have the correct “href” and “src” to the files you just uploaded.
- Continue editing the file spjs-cBox_CEWP.html to ensure all settings are set up like you want them – you find an overview of all settings below.
- Upload and overwrite the file spjs-cBox_CEWP.html in the /SPJS/cBox/ folder.
- Copy the full path to the file spjs-cBox_CEWP.html to your clipboard and go to the page where you want your CommentBox to appear. Add a Content Editor Web Part (CEWP) to the page, and edit the web part. Paste the path to the file spjs-cBox_CEWP.html in the Content link field in the web part properties.
- Save the changes to your CEWP and refresh the page. Follow the on screen instructions to create the lists used to store comments, likes and subscriptions.
Configuration options
attachments
type: boolean
attachmentSizeLimit
type: number
allCommentsMustBeApproved
type: boolean
If set to true, the comments will only show for users or groups specified in moderatorGroupIDorUserID and the author until they have been approved. Default value: false.
approverEmail
type: array of strings
approvalEmail
type: object
type: boolean
autoSubscribeToRootComments
type: boolean
categoryEnabled
type: boolean
categoryFIN
type: string
categories
type: array of strings
categoriesUserDefined
type: boolean
Should the users be able to add new categories? Default value: true.
categoryMandatory
type: boolean
Should the category field be mandatory to fill in? Default value: false.
colorMyComments
type: boolean
Shows a yellow left border on all comments by the logged in user. Default value: false.
commentFIN
type: string
FieldInternalName in the comments list where the comment is stored. Default value: “Comment”. Only change this if you have an existing list of comments and use another field to store the comment.
configListName
type: string
configListBaseUrl
type: string
configListHidden
type: boolean
containerWidth
type: string
dateFormat
type: string
New in v3.0.0.7.
Date format for all date values in cBox. Use it like this for 24 hour clock:
"MM/dd/yyyy HH:mm:ss"
or this for 12 hour clock:
"MM/dd/yyyy hh:mm:ss am/pm"
Possible values are:
MMMM = Long month
MMM = Short month
MM = Always two digits in month
M = Numeric month
dddd = Long day
ddd = Short day
dd = Always two digits in day
d = Numeric day
yyyy = 4 digit year
yy = 2 digit year
mm = minutes
hh = Hour in 12 hour format
HH = Hour in 24 hour format
ss = Second
am/pm = AM or PM indicator
Please note that you must update spjs-cBox-i18n.js to use MMMM, MMM, dddd and ddd.
Leave empty to use default browser date format
type: string
type: boolean
Should the footer row be visible? Default value: true.
headerRowTemplateOverride
type: string
iconsHorizontal
type: boolean
moderatorGroupIDorUserID
type: array of strings
ID of groups or users with admin / moderator rights. The Site collection admin is automatically moderator and don’t have to be added here. Default value: [].
moveCommentGroupName
type: array of strings
moveCommentThreadIdArr
type: array of objects
[{"disp":"Pending ideas", "threadID":"cBox:/Ideas/SitePages/PendingIdeas.aspx"}, {"disp":"Approved ideas", "threadID":"cBox:/Ideas/SitePages/ApprovedIdeas.aspx"}]
multiInstanceMode
type: boolean
newTopicButtonPosition
type: string
pageSize
type: number
placeholderID
type: string
replyLevels
type: number
restrictWriteAccessToGroups
type: array of strings
richTextInputUsingTinyMCE
type: boolean
searchEnabled
type: boolean
searchStringMinLength
type: number
showCategoryInComment
type: boolean
showCommentLink
type: boolean
showCatagoryFilter
type: boolean
showLikeButton
type: boolean
showDislikeButton
type: boolean
showProfileImage
type: boolean
showTopicCount
type: boolean
showTopicInComment
type: boolean
showUserEmail
type: boolean
sortAscending
type: boolean
subscriptionEnabled
type: boolean
subscriptionEmail
type: object
textareaHeight
type: number
textareaVisible
type: boolean
threadID
type: string
threadIDTrimmed
type: boolean
threadIDFIN
type: string
threadInitiallyCollapsed
type: boolean
timeZoneCorrection
type: string
Time zone correction in minutes if the created and modified does not show the correct date – leave empty if date is correct. Default value: “”
"timeZoneCorrection": _spPageContextInfo.webTimeZoneData.Bias + _spPageContextInfo.webTimeZoneData.DaylightBias
"timeZoneCorrection": new Date().getTimezoneOffset()
tinyMCE_Language
type: string
TinyMCE language – add more languages to folder /tinymce/js/langs or /tinymce_ie /js/langs. Already in package is “nl”, “de” and “nb_NO” – and the default “en”.
topicEnabled
type: boolean
topicFIN
type: string
topicMandatory
type: boolean
Intercepting adding or updating of comments
New in v3.0.0.6.
This lets you add or update metadata for the comments directly when they are added or updated, or trigger a custom function after a comment has been saved. To use this functionality you must add the functions you like to use to the page where the cBox is located.
cBoxItemAdding
Use this function to intercept the adding of a new comment:
function cBoxItemAdding(placeholderID,item){ // Add or update item attributes for example like this item.YouCustomColumn = "Your custom value"; // Return the changed item return item; }
cBoxItemAdded
Use this function to do something after a comment has been added:
function cBoxItemAdded(placeholderID,data){ // add your custom code here }
cBoxItemUpdating
Use this function to intercept the updating of a comment:
function cBoxItemUpdating(placeholderID,item){ // Add or update item attributes for example like this item.YouCustomColumn = "Your custom value"; // Return the changed item return item; }
cBoxItemUpdated
Use this function to do something after a comment has been updated:
function cBoxItemUpdated(placeholderID,data){ // add your custom code here }
Email construction variables
You can use these variables to built the email subject and body.
- {currentUser} = current user title
- {currentUserEmail} = current user email
- {author} = author of comment
- {authorEmail} = email address of author
- {editor} = the current editor of the comment
- {editorEmail} = email address of editor
- {commentLink} = link to comment
- {pageLink} = link to page
- {unsubscribeLink} = link to unsubscribe
- {topic} = comment topic
- {category} = comment category
- {comment} = comment text
These can only be used with the approval functionality:
- {approveComment} or {rejectComment} = link to approve or reject comment
- {rejectionReason} = text from textarea in reject comment dialog
Questions and feedback
If you have trouble setting it up, or you have other questions or feedback, you can use the forum.