Civil discourse is engagement in discourse (conversation) intended to enhance understanding.
Wikidedia
The loss of Civil Discourse has been decried in a wide range of publications, and the internet and social media have been cited as a primary cause of this decline.
The admin/b team took this as inspiration: can internet technology, and particularly the Sitecore Experience Platform and xConnect, help lead us back to using communication to enhance understanding rather than enflame passions? Our Civil Disourse module does not seek to ban people or prevent communication; rather it engages users by reminding them of the potential negative and positive impact of the words. When users comment using inflamatory or hurtful language, the module responds by recommendeing alternative phrasings that will have a more constructive impact. xConnect is used to persist users comments, and to track negative interactions, enabling a down mechanism to temporarily block submissions from users who are engaging in a high volume of potentially abusive interactions.
Before you can install Civil Discourse Module, you need to install the following items:
- Sitecore 9.0 rev. 171219 (Update-1) (https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/90/Sitecore_Experience_Platform_90_Update1.aspx)
- Install Sitecore package: CivilDiscourse-1.0.0.0.zip from the releases page: https://github.com/Sitecore-Hackathon/2018-admin-b/releases/tag/1.0.
- Publish with subitems the following paths:
- /sitecore/templates/System/Settings
- /sitecore/layout/Layouts/Project/Layouts
- /sitecore/layout/Models/Project/CivilCommentsSection
- /sitecore/layout/Renderings/Project/CivilCommentSectionController
- /sitecore/content/Home/Global Components
- /sitecore/content/Home/Settings
- /sitecore/content/Home
- Setup: Creating questionable words
The Civil Discourse Module uses a repository of word items in Sitecore to scan each submitted comment for inappropriate language. These "questionable words" are stored in Sitecore, under /sitecore/content/Home/Global Components/Word Repository. Each word has the following fields:
- Word - text field. The word itself. This is case insensitive, and can also be a comma-separated list of similar words (e.g. "idiot, idiots").
- Severity Level - dropdown field, uses /sitecore/content/Home/Global Components/Severity Levels. This determines the color that the word is highlighted with; severe words show up in red, mild words show up in yellow, etc. You can add as many severity levels as you like, with any valid color ("green") or hex value ("#eeeeee) in the Warning Color field.
- Custom Warning - text field. This field determines the message that is shown when the commenter hovers over the highlighted word, and should provide an explanation of why that word or phrase is discouraged.
The Civil Discourse Module uses global settings items to set the settings on the component and to retrieve and store user comments. The component settings item is location at /sitecore/content/Home/Settings/Settings. This item has the following fields:
- Flagged Words - multilist field. Select words from the Word Repo that you want to be flagged.
- Flagged Word Groups - multilist field, /sitecore/content/Home/Global Components/Word Groupings. A word grouping provides an easy way to group Word items together and select them all at once. A Word Grouping item also has a field for Warning Text, which will be used as the default warning text for every word in the group (overridden by Custom Warning Text on the Word item). For example, a warning group might be "Swears" or "Insults", and a standard warning can be applied across all insult words.
- Intro Text - rich text field. This field displays optional text at the top of the comments section. This can be a simple heading, a conversation prompt, etc.
The component has two parts, the comments list and the comment box. The comments are pulled from /sitecore/content/Home/Settings/Comments and displayed in date order, showing the username, the date posted, and the comment.
When a user submits a comment, the module scans the comment for questionable language. The Settings item is used to aggregate the Flagged Words and the Flagged Word Groups into a list of Word items (word, severity color, warning text). For each word in this list, we do a case-insensitive search of the commment using regex. If no flagged words are found, the comment is submitted; otherwise, the user is shown a review message which asks them to review their comment and consider removing or changing the highlighted words. The user can hover over each highlighted word to see a tooltip with the warning message.
If the user clicks submit again without changing their comment, they will be prompted with a message asking if they're sure they want to submit; if they do edit their comment, the comment will be scanned again, and either submitted or returned with warnings again. In order to submit a comment that has flagged language, the user must go through the "are you sure" prompt.
The optional cooldown field will disable the submit button for X seconds when a comment is returned with warnings. This prevents the user from submitting again immediately and encourages them to review and edit their comment. The cooldown can be as little as a few seconds, several minutes, or even hours, if the content editor is really sadistic.
Civil Discourse Module has several known issues. The notable issues are listed below:
- xConnect part doesn't yet work. Whoops. No reporting.
- When a Data Source is set on the Rendering, the component does not render, and does not show any helpful error messages. We have worked around this by using Global Settings, but this needs to be fixed so that unique settings can be applied to different pages.
- Civil Discourse Module 1.1
- Use Datasource Item on rendering instead of Global Settings, so that different settings can be applied to different pages
- Incremental cooldowns - multiple the cooldown time on subsequent comment submissions, so that a user keeps getting warnings every time they try to submit one comment, they have to wait longer each time to try submitting again.
- Block bad users - Track the number of warnings on the comments that each user submits, and enact temporary bans on users who can't behave (there would be some threshold for number of warnings within a certain time period)
Want to develop for Civil Discourse Module? Great! To get started developing for CivilDiscourse, you must first do some things:
- Be awesome in powerful ways!
Civil Discource Module was created by the Velir team admin/b (Dan Solovay, Ed Schwehm, Erica Stockwell-Alpert) as part of 2017 Sitecore Hackathon.
Team admin-b is brought to you by Daniel Solovay, Erica Stockwell-Alpert, and Ed Schwehm, sponsored by Velir.