Git Product home page Git Product logo

silverstripesk-silverstripe-disqus's Introduction

Installation & setup:

Download source code:

cd /path/to/your/silverstrie/installation/
git clone git://github.com/silverstripesk/silverstripe-disqus.git disqus

Or install with composer:

composer require "silverstripesk/silverstripe-disqus:*"

Activate in your config and Build

create mysite/_config/comments.yml and activate for your commentable class (or Page for all pagetypes)

---
Name: mysite-comments
---
BlogPost:
  extensions:
    - DisqusExtension

Build your ss installation - in browser visit following url:

http://your-ss-installation/dev/build

Setup in SiteConfig area

In backend visit SiteConfig area, tab Disqus, place required data:

  • disqus shortname (from your disqus account)
  • disqus secret key (from your disqus account)
  • disqus prefix (place there anything you want. Store diferent prefix for local and production, so thread identifier will be different and your local testing comments will not be shown on production.) By default, identifier looks like this: prefix_pageID. You can customize this for each Page (Behaviour tab, right above Comments checkbox) so you can show same comments on multiple pages (alternatively, create different forum for local copy of your site)...
  • Disqus sync time -> comments can be synced with disqus server for SS usage (e.g. generate comments for non javascript usage, search, latest comments listing...). Place time in seconds (3600 for 1 hour)
  • By default, time syncing works as standard php process within visitor's page load (so if there are some difficulties with disqus server connection, page load can be limited). You can enable background syncing, so syncing is independent from visitor's page load. Its alpha feature, tested only on linux!

Activate in your theme

Replace

$PageComments

with following code

$DisqusPageComments

if you are on some Page holder (list of pages), you can show comments count by adding:

<% if disqusEnabled %>$disqusCountLink<% end_if %>

Usage

If default comments module installed:

Check SS default Enable Page Comments Checkbox (located in Settings tab) to enable disqus comments

Else

Comments will be shown on all pagetypes activated in comments.yml

Collaboration

If you want to help out and make some improvements please fork this project and submit a pull request (see this guide on how to do this: Pull requests).

TODO

If silverstripe/comments module installed: sync both to have same comments on both sides

silverstripesk-silverstripe-disqus's People

Contributors

camfindlay avatar christopherdarling avatar silverstripesk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.