Mara flatfile CMS

Disqus Comments

The ability to add user comments to specific pages of your site drives traffic, and creates useful feedback.

Disqus is one of the more effective third-party comment systems. It operates entirely by way of Javascript, and does not require any data to be stored on the website's own server. It also integrates well with Facebook, Twitter and other social media accounts. You can find more details on

Whilst Disqus can in principle be added to any page, the Mara plugin makes this task very easy, and avoids the need to struggle with complex javascript. 

Firstly, if you have not done so already, go to and create a user account. Then, add a website identifier for your site. This should be any lowercase single word which represents the website. 

Set the sitename parameter in Mara's /sitecfg/sitieini.php file to match this identifier.

Now add the code:

<?php include(plugin('disqus'))?>

at the point where you wish the commenting interface to appear.

Note that you must put this text in the page source code, writing it into the online editor will literally put the textual equivalent of the code into the page, which will do nothing. 

As mentioned, the Mara sitename is used as the Disqus site identifier.  Individual page threads need some form of ID to segregate them, and Disqus uses the page title by default. In Mara we change this to instead use the page's filename on disk. This avoid the problem where a change of title will cause comments to disappear. Just bear in mind that renaming a file or moving it to a different directory will reset the page comments. Though, that is less likely to arise often, therefore we feel that use of the filename is more robust. (The reason, incidentally, Disqus itself does not use the filename is that it cannot access the server's filesystem info info via Javascript, whereas Mara can, using a php plugin.)

Since pages with Disqus comments are pages containing a script, they can only be edited online by Managers or Admins.

If you need to include the commenting facility in multiple pages, you can instead put a call to the plugin into the theme's footer area. Commenting enabled then becomes the default for all pages. Since Mara generates page IDs automatically from the filename, this will still provide individual page comment threads. To then disallow commenting in specific pages, set 'cms_hide' to 'bottom' in the meta tags for those pages.

An example:

Site: maracms Thread: d.php

You can of course  add more text below the plugin, if you like.


Powered by Mara cms