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。

在左側面板中,打開 Themes

開啟主題
開啟主題

Current theme 下,選取 Actions,然後選擇 Edit code

編輯程式碼
編輯程式碼

這會開啟程式碼編輯器,左側為檔案瀏覽器,右側為程式碼。

我們只需複製一小段可加入 FastComments 的程式碼,並貼到正確檔案的正確行。

在左側的檔案瀏覽器中,向下捲動並點選 Sections

選擇 Sections
選擇 Sections

現在我們將向下捲動並選擇 main-article.liquid

選擇 main-article
選擇 main-article

這會開啟用來呈現單篇部落格文章的 主題範本

你現在應該會看到類似下方的畫面,頂端已選取 main-article.liquid

main-article 已開啟
main-article 已開啟

步驟 4:加入 FastComments.com 代碼 Internal Link


接下來我們要捲動到第 100 行:

捲動到第 100 行
捲動到第 100 行

現在複製以下程式碼片段,此片段是專為 Shopify 設計 - 不要使用其他教學的程式碼片段:

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

現在我們要把游標放在第 101 行 - 就在 </div> 之後 - 然後貼上。你應該會看到類似的畫面:

加入 FastComments 程式碼
加入 FastComments 程式碼

現在我們可以儲存:

儲存
儲存

成功 Internal Link


現在如果我們查看一篇部落格文章,應該會看到 FastComments!

成功!
成功!

恭喜您已在 Shopify 上設置 FastComments!如果您遇到 Domain Error,或想了解如何自訂留言區域,請繼續閱讀!


自訂 Internal Link


FastComments 的設計可自訂以配合您的網站。

如果您想新增自訂樣式或微調設定,請查看我們的自訂與設定文件 以了解如何操作。