FastComments.com

Add Comments to Ionos Sites

FastComments を使えば、Ionos で構築された任意のサイトにライブコメント機能を簡単に追加できます。

このチュートリアルには FastComments アカウントが必要です。最初にサインアップしてからここに戻ってくることをおすすめします。アカウントはここで作成できます。

ステップ1:お問い合わせフォームを追加 Internal Link

まず、FastComments が置き換えるコンタクトフォームを追加します。

To do this, open the site editor, and click Add Section on the desired page.

Then, go to Content -> Contact -> Contact Form on the left, as shown:

コンタクトフォームを追加
Add Contact Form

Next, we need to tell FastComments to replace our form. Click on the default form title:

フォームタイトルを設定
Set Form Title

We'll set the title to FastComments Goes Here. It's very important that the casing and spacing is the same, or else it won't work, so we recommend you copy this text and paste it in.

When done, it should appear as follows:

タイトル設定完了
Done Setting Title

That's the end of step one!

ステップ2:FastComments.com のコードを追加 Internal Link


Next we're going to add the FastComments widget code to your site. This code will search for all forms with the title FastComments Goes Here and replace it with FastComments.

So let's go to Settings in the bottom left of the site editor:

設定を開く
設定を開く

Open the Custom Head Code section:

カスタムヘッドコードを開く
カスタムヘッドコードを開く

For Ionos we need a special version of the FastComments widget code. Code snippets from other tutorials will not work.

Now copy the following code:

Ionos の FastComments スニペット
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<script>
4 (function () {
5 let loaded = false;
6 let interval = null;
7
8 function attemptLoad() {
9 const nodes = document.querySelectorAll('h2');
10
11 nodes.forEach(function (node) {
12 if (node.innerText && node.innerText.trim() === 'FastComments Goes Here') {
13 // フル幅ではない要素を取得します
14 const target = node.parentNode.parentNode.parentNode.parentNode.parentNode;
15 target.innerHTML = '';
16 FastCommentsUI(target, {
17 tenantId: "demo"
18 });
19 interval && clearInterval(interval);
20 loaded = true;
21 }
22 });
23 }
24
25 attemptLoad();
26 if (!loaded) {
27 interval = setInterval(attemptLoad, 300);
28 }
29 })();
30</script>
31

...and paste it in as shown:

貼り付けて保存
貼り付けて保存

ステップ3:公開 Internal Link

これでサイトを公開すれば完了です。

左上の Content をクリックしてコンテンツエディタに戻ります:

コンテンツに戻る
コンテンツに戻る

それから公開できます!

公開!
公開!

以上です!FastComments がサイトで稼働しているはずです。以下のように表示されます:

完了!
完了!

完了 Internal Link


よくできました!Ionos サイトにライブコメントを追加しました。

権限が拒否されるエラーが発生した場合、または FastComments をカスタマイズしたい場合は、続きをお読みください。

カスタマイズ Internal Link


FastComments は、あなたのサイトに合わせてカスタマイズできるように設計されています。

カスタムスタイルを追加したり設定を調整したい場合は、カスタマイズと設定に関するドキュメント をご確認ください。方法がわかります。