krautgortna/statamic-disqus

This Statamic Addon adds a Disqus comment section to your Statamic views

v1.2 2023-02-10 09:21 UTC

This package is auto-updated.

Last update: 2024-12-10 13:05:46 UTC


README

Statamic 3 Software License Downloads Create Release

Features

  • Provides Antlers tags that can be used in any frontend view
  • Easily provide a discussion thread id as a parameter
  • For API calls: decide if you want to make a server- or client-side API call

Tags

  • {{ disqus:comments id="id" }} to load the Disqus embed plugin for a given thread
  • {{ disqus:count id="id" }} to show the number of comments ("posts") of a given thread
  • {{ disqus:likes id="id" }} to show the number of likes of a given thread

How to Use

First of all, provide your Disqus forum's shortname via the .env file:

DISQUS_SHORTNAME="your_shortname"

In the Antlers template, you can now use

{{ disqus:comments id="id" }}

Provide a variable as the thread id, e.g. when the slug is the Disqus thread id:

{{ disqus:comments :id="slug" }}

All .env Parameters

  • DISQUS_SHORTNAME="your_shortname" to identify your account
  • DISQUS_SECRET used for server-side API calls
  • DISQUS_API_KEY used for client-side API calls
  • DISQUS_METHOD choose between 'server' or 'client' API calls (note that the Disqus embed is always loaded on client side)

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require krautgortna/statamic-disqus