Mecha CMS

Add extra functionality to the core engine.

Comment

Built-in commenting system.

Installation 

Edit the page.php file in your active shield folder then put this snippet after the </article> tag:

<?php static::comments(); ?>

Comment Flags 

You can set specific comment visibility through page properties. Add a comment property within your page’s state property with one of these values:

ValueDescription
0Disable comments.
1Enable comments (default).
2Disable comments, but keep the published comments remain visible.
falseAlias for 0.
trueAlias for 1.

Example:

---
title: Page Title
description: Page description.
author: Taufik Nurrohman
type: Markdown
state:
  comment: false
...

Page content.

To set pre-defined comment visibility globally, specify a comment flag on the first array of the shield arguments:

<?php static::comments([2]); ?>

Constant 

This extension will add a folder called comment in the .\lot folder, which will also automatically add a constant named COMMENT.

COMMENT

Class 

We now have a Comment class which works the same as the Page class, but with custom hook namespace:

Comment(string $path = null, array $lot = [], $NS = ['*', 'comment']);

Example:

$comment = new Comment('.\lot\comment\article\test-page\2014-05-05-09-09-32.page');

Dependency 

Extension 

Conflict With 

Plugin 

0 Comments

No comments yet.