FastComments.com

Add Comments to Wix Sites

ืขื FastComments ื ื•ื›ืœ ื‘ืงืœื•ืช ืœื”ื•ืกื™ืฃ ืชื’ื•ื‘ื•ืช ื‘ื–ืžืŸ ืืžืช ืœื›ืœ ืืชืจ Wix. ื ืกืงื•ืจ ื’ื ื›ื™ืฆื“ ืœื”ื‘ื˜ื™ื— ืฉืœื›ืœ ื“ืฃ, ืื• ืคื•ืกื˜ ื‘ื‘ืœื•ื’, ื™ื”ื™ื” ืฉืจืฉื•ืจ ืชื’ื•ื‘ื•ืช ื™ื™ื—ื•ื“ื™ ืžืฉืœื•.

ืฉื™ืžื• ืœื‘ ืฉืžื“ืจื™ืš ื–ื” ื“ื•ืจืฉ ื—ืฉื‘ื•ืŸ FastComments. ืžื•ืžืœืฅ ืœื”ื™ืจืฉื ืงื•ื“ื ื•ืœืื—ืจ ืžื›ืŸ ืœื—ื–ื•ืจ ืœื›ืืŸ. ื ื™ืชืŸ ืœื™ืฆื•ืจ ื—ืฉื‘ื•ืŸ ื›ืืŸ.


ืฉืœื‘ 1: ืขืจื•ืš ืืช ื”ื“ืฃ ื”ื ื›ื•ืŸ Internal Link

ื‘ื“ื•ื’ืžื” ื–ื•, ื ื•ืกื™ืฃ ืืช FastComments Live Commenting ืœืขืžื•ื“ื™ ืคื•ืกื˜ื™ื ื‘ื‘ืœื•ื’.

ืœืฉื ื›ืš, ื ืคืชื— ืืช ื”ืืชืจ ืฉืœื ื• ื‘ืขื•ืจืš ืฉืœ Wix.

ืœืื—ืจ ืžื›ืŸ, ื ื•ื•ื“ื ืฉืื ื• ืขื•ืจื›ื™ื ืืช ื”ื“ืฃ ื”ื ื›ื•ืŸ.

ื‘ืจืฆื•ื ื ื• ืœื•ื•ื“ื ืฉื ืฆื™ื’ ืฉืจืฉื•ืจ ืชื’ื•ื‘ื•ืช ื™ื™ื—ื•ื“ื™ ืขื‘ื•ืจ ื›ืœ ืคื•ืกื˜ ื‘ื‘ืœื•ื’, ืœื›ืŸ ื ืขืจื•ืš ืืช Blog Pages -> Post.

ืฉืœื‘ ืจืืฉื•ืŸ: ืขืจื™ื›ืช ื“ืฃ ื”ืคื•ืกื˜ ื”ื“ื™ื ืžื™
Edit The Dynamic Post Page

ืฉืœื‘ 2: ื”ื•ืกืฃ ื‘ืœื•ืง ื”ื˜ืžืขื” Internal Link


ืœืื—ืจ ืžื›ืŸ, ื ืขื‘ื•ืจ ืืœ Add -> Embed Code -> Embed HTML.

ืฉืœื‘ ืฉื ื™: ื”ื•ืกืคืช ื‘ืœื•ืง Embed HTML
ื”ื•ืกืคืช ื‘ืœื•ืง Embed HTML

This will give us a sad looking box to start with:

ื”ื‘ืœื•ืง ื”ื”ืชื—ืœืชื™
ื”ื‘ืœื•ืง ื”ื”ืชื—ืœืชื™

ืฉืœื‘ 3: ื”ืขืชืง ื•ื”ื“ื‘ืง ืงื•ื“ ืžื•ืชืื ืื™ืฉื™ืช Internal Link


ื“ื•ื’ืžื” ื–ื• ืžืฉืชืžืฉืช ื‘ืงื•ื“ ืžื•ืชืื ื›ื“ื™ ืœื”ื™ื•ืช ืชื•ืืžืช ืœ-Wix. ืœื ืชื•ื›ืœื• ืœื”ืฉืชืžืฉ ื‘ืงื˜ืขื™ ื”ืงื•ื“ ืฉืœ FastComments ืžื”ื”ื“ืจื›ื•ืช ื”ืื—ืจื•ืช.

Open the form to add our custom HTML dialog by clicking Enter Code and selecting HTML:

ืฉืœื‘ 3: ืคืชื— ื—ืœื•ื ื™ืช HTML
ืฉืœื‘ 3: ืคืชื— ื—ืœื•ื ื™ืช HTML

Copy the following HTML snippet and paste it into the dialog, and click Update:

ืงื˜ืข ืงื•ื“ ืœืชื’ื•ื‘ื•ืช Wix
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 (function () {
6 const config = {
7 tenantId: "demo"
8 };
9 const instance = FastCommentsUI(document.getElementById('fastcomments-widget'), config);
10 window.onmessage = (event) => {
11 if (event.data) {
12 if (event.data.action === 'reload') {
13 console.log('Updating FastComments:', event.data.url);
14 config.urlId = event.data.url;
15 config.url = event.data.url;
16 instance.update(config);
17 }
18 }
19 }
20 })();
21</script>
22
ืฉืœื‘ 3: ื”ื“ื‘ืง ื•ืฉืžื•ืจ
ืฉืœื‘ 3: ื”ื“ื‘ืง ื•ืฉืžื•ืจ

You should now see a very tiny version of the comment widget:

ืฉืœื‘ 3: ื”ืชื•ืฆืื”
ืฉืœื‘ 3: ื”ืชื•ืฆืื”

Next we will position and size this to fit our page.


ืฉืœื‘ 4: ืฉื ื” ืืช ื”ื’ื•ื“ืœ Internal Link


ืขื›ืฉื™ื•, ืœืื—ืจ ืฉื”ื•ืกืคื ื• ืืช ื•ื•ื™ื“ื’'ื˜ ื”ื”ืขืจื•ืช, ื‘ื•ืื• ื ืกื“ืจ ืื•ืชื• ื‘ืขืžื•ื“ ืฉืœื ื•.

ืฉืœื‘ 4: ืฉื™ื ื•ื™ ื’ื•ื“ืœ
ืฉืœื‘ 3: ืฉื™ื ื•ื™ ื’ื•ื“ืœ

ืขื ื”ืžื“ืจื™ืš ื”ื–ื” ื ื•ื›ืœ ืœืฉื ื•ืช ืืช ื”ืฉืจืฉื•ืจ ื”ื ื•ื›ื—ื™ ื‘ื”ืชืื ืœืขืžื•ื“ ื”ืคืขื™ืœ. ืขื ื–ืืช, ืœื ื ื•ื›ืœ ืœืฉื ื•ืช ืืช ื’ื•ื“ืœ ื•ื•ื™ื“ื’'ื˜ ื”ื”ืขืจื•ืช ื‘ืื•ืคืŸ ื“ื™ื ืžื™ ืขื“ ืฉึพWix ืชืืคืฉืจ ื–ืืช. ืขื“ ืื–, ืชืฆื˜ืจืš ืœื”ื—ืœื™ื˜ ื›ืžื” ื’ื“ื•ืœ ืชืจืฆื” ืฉื”ืื–ื•ืจ ืฉืœ ื”ื”ืขืจื•ืช ื‘ืขืžื•ื“ ืฉืœืš ื™ื”ื™ื” ื•ืœื’ื•ื“ืœื• ื‘ื”ืชืื.


ืฉืœื‘ 5: ืฉืจืฉื•ืจื™ ืชื’ื•ื‘ื•ืช ื™ื™ื—ื•ื“ื™ื™ื Internal Link

Next, let's set things up so that the comment thread changes based on the current page, allowing users to discuss the currently displayed content.

ื›ืขืช ื ื’ื“ื™ืจ ืืช ื”ื“ื‘ืจื™ื ื›ืš ืฉืฉืจืฉื•ืจ ื”ื”ืขืจื•ืช ื™ืฉืชื ื” ื‘ื”ืชืื ืœื“ืฃ ื”ื ื•ื›ื—ื™, ืžื” ืฉื™ืืคืฉืจ ืœืžืฉืชืžืฉื™ื ืœื“ื•ืŸ ื‘ืชื•ื›ืŸ ื”ืžื•ืฆื’ ื›ืขืช.

Without the following steps, you will only have one global comment thread for your entire site - which is not very useful.

ืœืœื ื”ืฉืœื‘ื™ื ื”ื‘ืื™ื, ื™ื”ื™ื” ืœื›ื ืฉืจืฉื•ืจ ื”ืขืจื•ืช ื’ืœื•ื‘ืœื™ ืื—ื“ ืœื›ืœ ื”ืืชืจ โ€” ื•ื–ื” ืœื ืžืื•ื“ ืฉื™ืžื•ืฉื™.

ืžืฆื‘ ืคื™ืชื•ื—

To add this functionality, we'll have to go into what Wix calls Dev Mode.

ื›ื“ื™ ืœื”ื•ืกื™ืฃ ืคื•ื ืงืฆื™ื•ื ืœื™ื•ืช ื–ื•, ื ืฆื˜ืจืš ืœื”ื™ื›ื ืก ืœืžื” ืฉ-Wix ืงื•ืจืืช Dev Mode.

Click the Dev Mode option at the top of the screen.

ืœื—ืฆื• ืขืœ ื”ืืคืฉืจื•ืช Dev Mode ื‘ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ื”ืžืกืš.

ื”ืคืขืœืช ืžืฆื‘ ืคื™ืชื•ื—
ื”ืคืขืœืช ืžืฆื‘ ืคื™ืชื•ื—

ื”ื’ื“ืจ ืืช ืžื–ื”ื” ื”ืืœืžื ื˜

We're going to add custom code to accomplish this, but first we need to give the new embed element an ID to refer to it by.

ื ื•ืกื™ืฃ ืงื•ื“ ืžื•ืชืื ื›ื“ื™ ืœื‘ืฆืข ื–ืืช, ืื‘ืœ ืงื•ื“ื ืขืœื™ื ื• ืœืชืช ืœืจื›ื™ื‘ ื”ื”ื˜ืžืขื” ื”ื—ื“ืฉ ืžื–ื”ื” ืฉื ื•ื›ืœ ืœื”ืชื™ื™ื—ืก ืืœื™ื•.

Let's call it fastcomments.

ื ืงืจื ืœื• fastcomments.

Click the new embed element we added, and in dev mode in the bottom right you should see an ID field with a value like html1:

ืœื—ืฆื• ืขืœ ืจื›ื™ื‘ ื”ื”ื˜ืžืขื” ื”ื—ื“ืฉ ืฉื”ื•ืกืคื ื•, ื•ื‘ืžืฆื‘ ื”ืคื™ืชื•ื— ื‘ืคื™ื ื” ื”ื™ืžื ื™ืช ื”ืชื—ืชื•ื ื” ืืžื•ืจ ืœื”ื•ืคื™ืข ืฉื“ื” ID ืขื ืขืจืš ื›ืžื• html1:

ืฉื“ื” ื”-ID
ืฉื“ื” ื”-ID

Change this to fastcomments and hit enter:

ืฉื ื• ื–ืืช ืœ-fastcomments ื•ืœื—ืฆื• Enter:

ื”ื’ื“ืจ ืืช ื”-ID
ื”ื’ื“ืจ ืืช ื”-ID

Now we can add our custom code that tells the comment area what page we are viewing.

ื›ืขืช ื ื•ื›ืœ ืœื”ื•ืกื™ืฃ ืืช ื”ืงื•ื“ ื”ืžื•ืชืื ืฉืœื ื• ืฉืžื•ื“ื™ืข ืœืื–ื•ืจ ื”ื”ืขืจื•ืช ืื™ื–ื” ื“ืฃ ืžื•ืฆื’ ื›ืขืช.

At the bottom of the screen you should see a code editor like this:

ื‘ืชื—ืชื™ืช ื”ืžืกืš ืืžื•ืจ ืœื”ื•ืคื™ืข ืขื•ืจืš ืงื•ื“ ื›ื–ื”:

ืคืชื— ืืช ื”ืขื•ืจืš
ืคืชื— ืืช ื”ืขื•ืจืš

Copy the following code and paste it in there:

ื”ืขืชื™ืงื• ืืช ื”ืงื•ื“ ื”ื‘ื ื•ื”ื“ื‘ื™ืงื• ืื•ืชื• ืฉื:

ืงื˜ืข ื ื™ื•ื•ื˜ ืœืชื’ื•ื‘ื•ืช ืฉืœ Wix
Copy Copy
1
2import wixLocation from 'wix-location';
3
4$w.onReady(function () {
5 function updateFastCommentsLocation() {
6 try {
7 const url = (wixLocation.baseUrl + '/' + wixLocation.path).replace(/,/g, '/');
8 $w('#fastcomments').postMessage({'action': 'reload', 'url': url});
9 } catch (err) {
10 console.error('Wix -> FastComments Error', err);
11 }
12 }
13
14 updateFastCommentsLocation();
15 wixLocation.onChange( () => {
16 updateFastCommentsLocation();
17 });
18});
19
ื”ื•ืกืฃ ืืช ืงื•ื“ ื”ื ื™ื•ื•ื˜
ื”ื•ืกืฃ ืืช ืงื•ื“ ื”ื ื™ื•ื•ื˜

ืฉืœื‘ 6: ื—ื’ื•ื’ Internal Link

ืขื›ืฉื™ื• ื ื•ื›ืœ ืœื ืฉื•ื ื•ืœื”ืฆื™ื’ ืชืฆื•ื’ื” ืžืงื“ื™ืžื” ืฉืœ ื”ืืชืจ ืฉืœื ื•. ืขืœื™ื›ื ืœืจืื•ืช ืื–ื•ืจ ืชื’ื•ื‘ื•ืช ืฉืžืฉืชื ื” ื‘ื”ืชืื ืœื“ืฃ ื”ื ืชื•ืŸ. ื›ืœ ื”ื›ื‘ื•ื“!

ืื ื™ืฉ ืœื›ื ื‘ืขื™ื•ืช, ื”ื•ื“ื™ืขื• ืœื ื• ื‘ืชื™ื‘ืช ื”ืชื’ื•ื‘ื•ืช ืœืžื˜ื”.

ื”ืชืืžื” ืื™ืฉื™ืช Internal Link

FastComments ืชื•ื›ื ืŸ ื›ืš ืฉื ื™ืชืŸ ืœื”ืชืื™ืžื• ื›ื“ื™ ืฉื™ืชืื™ื ืœืืชืจ ืฉืœืš.

ืื ื‘ืจืฆื•ื ืš ืœื”ื•ืกื™ืฃ ืขื™ืฆื•ื‘ ืžื•ืชืื ืื™ืฉื™ืช, ืื• ืœืฉื ื•ืช ืืช ื”ืชืฆื•ืจื”, ืขื™ื™ืŸ ื‘ืชื™ืขื•ื“ ื”ื”ืชืืžื•ืช ื•ื”ื”ื’ื“ืจื•ืช ืฉืœื ื• ื›ื“ื™ ืœืœืžื•ื“ ื›ื™ืฆื“.