FastComments.com

Add Comments With Memberstack


Con FastComments, possiamo configurare commenti esclusivi riservati ai soli membri quando combinato con Memberstack!


Il codice Internal Link

Possiamo facilmente collegare FastComments con Memberstack con un piccolo frammento di codice:

FastComments Memberstack Snippet
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget"></div>
4<script>
5 window.$memberstackDom.getCurrentMember().then(({data: member}) => {
6 if (member) {
7 FastCommentsUI(document.getElementById('fastcomments-widget'), {
8 tenantId: "demo",
9 urlId: window.location.pathname,
10 simpleSSO: {
11 username: member.customFields.name || member.auth.email.replace(/@.+/, ''),
12 email: member.auth.email,
13 avatar: member.customFields.avatar
14 }
15 });
16 } else {
17 FastCommentsUI(document.getElementById('fastcomments-widget'), {
18 tenantId: "demo",
19 urlId: window.location.pathname,
20 simpleSSO: null
21 });
22 }
23 })
24</script>
25

Quando l'utente visita il tuo sito o applicazione mentre è connesso tramite Memberstack, accederà automaticamente a FastComments e i suoi commenti saranno contrassegnati come Verified.

Potranno anche commentare lasciando il loro nome e la loro e-mail, se non sono connessi.

Commenti solo per membri

Se desideri avere commenti solo per membri, prova il seguente frammento di codice, ma cambia https://example.com/login con il luogo dove vuoi che gli utenti vadano quando cliccano sul pulsante Login:

Exclusive FastComments Memberstack Snippet
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget"></div>
4<script>
5 window.$memberstackDom.getCurrentMember().then(({data: member}) => {
6 if (member) {
7 FastCommentsUI(document.getElementById('fastcomments-widget'), {
8 tenantId: "demo",
9 urlId: window.location.pathname,
10 simpleSSO: {
11 username: member.customFields.name || member.auth.email.replace(/@.+/, ''),
12 email: member.auth.email,
13 avatar: member.customFields.avatar
14 }
15 });
16 } else {
17 FastCommentsUI(document.getElementById('fastcomments-widget'), {
18 tenantId: "demo",
19 urlId: window.location.pathname,
20 simpleSSO: {
21 loginURL: 'https://example.com/login'
22 }
23 });
24 }
25 })
26</script>
27

Personalizzazione Internal Link

FastComments è progettato per essere personalizzato in modo da corrispondere al tuo sito.

Se desideri aggiungere stili personalizzati o modificare la configurazione, consulta la nostra documentazione sulla personalizzazione per scoprire come.