Skip to content

Latest commit

 

History

History
50 lines (27 loc) · 2.5 KB

File metadata and controls

50 lines (27 loc) · 2.5 KB

Article Vote for Guest User in Lightning Community

Github Workflow codecov

Let guest user in Salesforce community vote on articles, and see results in a custom object

English | 日本語

Prerequisite

  • Lightning Knowledge is enabled
  • Single language

How to use

  1. Install package (Production/DE | Sandbox), or clone the repository and push/deploy source to the target org.

  2. Put Article Vote for Guest Users on Article Detail page of your community.

  3. Set Record Id to {!recordId} on the component setting.

  4. (If necessary) Change message and label on the component setting.

  5. If you enabled Allow voting on articles in standard Article Content component, make sure that this vote component is visible for only guest users.

  1. Allow the guest user profile to access GuestArticleVoteController Apex class.

Vote result

Vote result is stored in GuestArticleVote__c custom object. This custom object has the following fields. Create a report of this object for your knowledge improvement lifecycle.

  • Knowledge : Lookup to Knowledge Article Version (NOTICE: Make sure to select 'Read-Only' when you modify this field to master-detail)
  • Guest User Id : Unique Id for guest users. This value is saved to cookie on guest users' browser to avoid duplicate vote.
  • Upvoted? : Checked if upvoted.

Motivation

Based on the idea "Let UNAUTHENTICATED community users vote on articles when using Napili Template". In classic, PKB by Salesforce Labs is available but it won't be updated and Lightning Knowledge is not supported.

Feedback/Contributing

Feature requests, bug reports and pull requests are welcome!

License

The source code is licensed under the MIT license