FastComments.com

Add Live Commenting to Drupal Sites

安裝 Internal Link


FastComments 的 Drupal 模組用快速、即時的留言系統取代 Drupal 內建的留言功能。該模組已在 已在 drupal.org 發佈,支援 Drupal 10 與 11。

有兩種安裝方式。

Install with Composer

composer require drupal/fcom
drush en fastcomments

Install manually

drupal.org/project/fcom 下載模組,並將它放到你網站的 modules/custom/fastcomments/ 目錄。然後使用 drush en fastcomments 啟用,或從管理介面的 Extend (/admin/modules) 啟用。

注意! 模組只依賴 Drupal 核心(userfield)。不需要其他 Drupal 模組或函式庫。

啟用模組後,前往 Configuration 區段以設定你的 Tenant ID 和 API Secret。


小工具區塊 Internal Link

此模組提供數個區塊,可以從 Structure > Block layout (/admin/structure/block) 放置。

  • FastComments Widget - 主要的留言元件。會自動偵測當前實體。它會跳過已附加 FastComments 欄位的實體,因此您不會在相同頁面看到重複的元件。
  • FastComments Live Chat - 即時串流聊天。可以與相同頁面的評論欄位並排放置。
  • FastComments Collab Chat - 文字選取的註解與討論。
  • FastComments Image Chat - 基於座標的圖片註解。訪客點擊圖片即可留下與特定位置相關聯的評論。
  • FastComments Recent Comments - 顯示整個網站的最新評論。數量可在區塊上設定。
  • FastComments Top Pages - 顯示網站上評論數最多的頁面。

以內容為中心的區塊(Live Chat、Collab Chat、Image Chat)會自動偵測當前實體,並在非實體頁面時退回使用基於路徑的識別符。這表示它們可在分類法頁面、Views 與自訂路由上運作,無需任何額外設定。

內容類型欄位 Internal Link


對於大多數網站,新增評論最簡單的方法是將 FastComments 欄位附加到您的內容類型。前往 Structure > Content types > [type] > Manage fields 並新增該欄位。

Each entity that has the field gets:

  • 一個 狀態切換,讓編輯可以對每個實體啟用或停用評論。
  • 一個可選的 自訂識別符,讓您可以使用不綁定於 Drupal 實體路徑的穩定 ID。

The main FastComments Widget block knows about this field, and will skip entities that already have it attached. That way you can mix per-entity comments with the block without seeing the widget twice on the same page.

權限 Internal Link

此模組新增三個 Drupal 權限,可在 People > Permissions 下為每個角色分配。

  • Administer FastComments - 可存取位於 /admin/config/content/fastcomments 的 FastComments 設定表單。
  • View FastComments - 需要此權限才能看到留言小工具。沒有此權限時小工具不會渲染。
  • Toggle FastComments - 允許使用者使用欄位小工具針對每個實體啟用或停用評論。

預設只有擁有 administer site configuration 權限的使用者可以變更 FastComments 設定。若您希望訪客能看到小工具,請將 View FastComments 權限授予匿名及已驗證的使用者。

多語系 Internal Link

此模組會自動將目前 Drupal 站點的語言傳遞給每一個 FastComments 小工具。如果您的 Drupal 站點設定為多種語言,留言介面將在對應語言中呈現,無需任何額外設定。

這適用於所有小工具類型:Live Comments, Streaming Chat, Collab Chat, Image Chat, Recent Comments, and Top Pages.

歐盟資料駐留 Internal Link


如果您的 FastComments 帳戶託管在歐盟 (EU),請在 Administration > Configuration > Content > FastComments 更新兩個設定:

  • CDN URL - https://cdn-eu.fastcomments.com
  • Site URL - https://eu.fastcomments.com

您還需要從位於 eu.fastcomments.com/auth/my-account/api 的歐盟儀表板中擷取您的 Tenant ID 和 API Secret,而不是從預設的美國儀表板。模組的其他部分則相同。


自訂 Internal Link


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

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