Skip to content

CoderofOne/kirby-comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image

Kirby Comments (v1.0.0)

A drop-in, database-free comment system for Kirby CMS 5+ with moderation, replies, a pending-only inbox view in the Panel and spam protection.

✨ Features

  • Frontend comment form (posts to the article URL)
  • Panel moderation (approve / deny / delete)
  • Pending-only inbox at the Site level
  • Approved / pending comment counts
  • Create new comments or edit existing
  • Add a reply to comment
  • Spam protection (honeypot + rate limiting)
  • CSRF protection
  • Server-side validation
  • Easily style the ID's and Classe names from within your own stylesheet to match your website design
  • Additional features to come in future updates such as email notification, basic drop in styles, etc

🧭 Moderation Workflow

  1. Visitors submit comments → saved as pending
  2. Editors open Site → Pending Comments
  3. Click the article → approve / deny comments
  4. Approved comments appear on the frontend
Image Image Image

📦 Manual Installation

Download nomad-kirby-comments.zip

Unzip file

Copy the plugin folder to: site/plugins/nomad-kirby-comments

Panel: Article blueprint

Add the comments field to your article blueprint (site/blueprints/pages/article.yml) or whichever template you are using for article.

comments:
  extends: fields/comments

Panel: Pending-Only Inbox (Site tab)

Add this tab to your site/blueprints/site.yml:

tabs:
  comments:
    label: Pending Comments
    icon: chat
    sections:
      pendingComments:
        type: pages
        headline: Pending Comments
        layout: table
        query: site.index.filterBy("intendedTemplate","article").filterBy("comments","*=","pending")
        info: "{{ page.pendingCommentsCount }} pending · {{ page.approvedCommentsCount }} approved"
        limit: 50
        create: false
        sortable: false
        duplicate: false
        status: false

Panel: Articles with Comments-Only Inbox (Site tab)

Add this tab within your 'tabs' section to your site/blueprints/site.yml:

articleswithcomments:
    label: Articles with Comments
    icon: chat
    sections:
      existingcomments:
        type: pages
        headline: Articles with Comments
        query: site.index.filterBy("intendedTemplate", "article").filterBy("comments", "!=", "")
        info: "{{ page.comments.toStructure.count }} comments"
        limit: 50
        create: false
        sortable: false
        duplicate: false
        status: false

Important

  • Site Tab assumes you are using the template "article". If you use a different named template the "site tab" will not work unless you update the template name within ("intendedTemplate","article") in the site.yml file under the query line.

Frontend: Show comments + form

Image

In your article template:

<?php snippet('comments') ?>

Only approved comments display publicly; new submissions are saved as pending.

Frontend: Show counts on lists

Image

In your article list loop:

<?php snippet('comment-meta', ['page' => $article]) ?>

Important

  • This snippet assumes you are using the page "article", if you are using a different page name update the $article variable to match page name. (i.e $post)

Storage

Comments are stored in the article content txt file as a YAML structure field.

Image

License

MIT

About

A lightweight, database-free comment system for Kirby CMS 5+, designed to feel native to Kirby while providing a clean moderation workflow.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages