FastComments.com

Add Comments to Shopify Sites

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

以下の手順は Shopify 上に構築されたブログ向けですが、埋め込みコードは他のテーマファイルを編集して任意のページに手動で追加することもできます。FastComments サポートでも支援を行っています。

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

ステップ 2: デフォルトのコメント機能を無効化 Internal Link

FastComments を Shopify で使用する最初のステップは、Shopify のコメントシステムを無効にすることです。

注意 FastComments サポートは既存のコメントスレッドの移行を支援できます。

Shopify のコメントシステムを置き換えるために、ストアのダッシュボードに移動して左下の Blog posts をクリックします:

ブログ投稿管理を開く
ブログ投稿管理を開く

次に右上の Manage blogs をクリックします:

ブログを管理
ブログを管理

管理したいブログをクリックします。Comments are disabled と表示されている場合は、この手順はスキップして Step Two に進めます。

ブログを管理
ブログを管理

そうでない場合は、ブログを選択し、右側のパネルで Comments are disabled が選択されていることを確認します:

コメントを無効にする
コメントを無効にする

保存をクリックします。

ステップ 3: ブログのテーマテンプレートを開く Internal Link

これからストアのテーマを編集して FastComments を追加します。

In the left panel, open Themes:

Themes を開く
Themes を開く

Under Current theme, select Actions and then Edit code:

コードを編集
コードを編集

This will open up a code editor, with a file browser on the left and the code on the right.

All we need to do is copy a small piece of code that adds FastComments and paste it on the right line in the right file.

In the file browser on the left, scroll down and click Sections:

Sections を選択
Sections を選択

Now we're going to scroll down and select main-article.liquid:

main-article を選択
main-article を選択

This will open the theme template used to render a single blog article.

You should now see something similar to the following, with main-article.liquid selected at the top:

main-article が開かれている
main-article が開かれている

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

次に、100 行までスクロールします:

100行までスクロール
100行までスクロール

Now copy the following code snippet, which is designed specifically for Shopify - do not use code snippets from other tutorials:

Shopify 用 FastComments スニペット
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget" class="page-width page-width--narrow"></div>
4<script>
5 FastCommentsUI(document.getElementById('fastcomments-widget'), {
6 tenantId: "demo",
7 urlId: window.location.pathname
8 });
9</script>
10

次に、カーソルをline 101 - </div> の直後 - に置いて貼り付けます。次のようになっているはずです:

FastComments コードを追加
FastComments コードを追加

これで保存できます:

保存
保存

完了 Internal Link

これでブログ記事を表示すると、FastComments が表示されるはずです!

成功!
成功!

Shopify で FastComments を設定したこと、おめでとうございます!Domain Error に遭遇した場合、またはコメント欄をカスタマイズする方法を学びたい場合は、続きをお読みください!

カスタマイズ Internal Link


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

カスタムスタイリングを追加したり設定を調整したい場合は、詳細についてカスタマイズのドキュメントをご覧ください。