adrienpayet / front-comments
Kirby plugin for adding comments anywhere in front-end pages.
Requires
- dev-main
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.35
- 0.10.34
- 0.10.33
- 0.10.32
- 0.10.31
- 0.10.30
- 0.10.29
- 0.10.28
- 0.10.27
- 0.10.26
- 0.10.25
- 0.10.24
- 0.10.23
- 0.10.22
- 0.10.21
- 0.10.20
- 0.10.19
- 0.10.18
- 0.10.17
- 0.10.16
- 0.10.15
- 0.10.14
- 0.10.13
- 0.10.12
- 0.10.11
- 0.10.10
- 0.10.9
- 0.10.8
- 0.10.7
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.1
- 0.10.0
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.19
- 0.8.18
- 0.8.17
- 0.8.16
- 0.8.15
- 0.8.14
- 0.8.13
- 0.8.12
- 0.8.11
- 0.8.10
- 0.8.9
- 0.8.8
- 0.8.7
- 0.8.6
- 0.8.5
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2025-03-14 15:18:19 UTC
README
Kirby front comments plugin
The Kirby Front Comments plugin allows you to add comments anywhere in the front-end of your Kirby website, making it easy for admins, developers, designers and other collaborators to communicate and collaborate directly on the site. It automatically integrate contextual information to each comment, such as user agent, window width, date and time, making it a valuable tool for debugging and troubleshooting.
In addition, the plugin can be connected to your GitHub, GitLab (including Framagit) account, allowing you to create and close issues directly from your website. This makes it easy to track and manage issues, and to keep all your collaboration in one place.
Setup
Install
Composer is the recommended way to install the plugin. Run the following command in your terminal:
composer require adrienpayet/front-comments
Alternatively, you can download this repository and add it to the /site/plugins directory of your project.
Include the snippet
Add the snippet anywhere inside the <head>
of your header: <?php snippet('front-comments') ?>
.
Connect with GitHub or GitLab repository (optional)
To create issues directly from comments on the website, add the repository informations to the plugin repo
option :
/site/config/config.php
:
return [
'adrienpayet.front-comments.repo.service' => 'github', // REQUIRED - 'github' | 'gitlab' | 'framagit' (case insensive)
'adrienpayet.front-comments.repo.token' => 'glpat-xxxxxxxxxxxxxxxxxxxx', // REQUIRED - access token (see below)
'adrienpayet.front-comments.repo.owner' => 'username', // REQUIRED
'adrienpayet.front-comments.repo.name' => 'repository name', // REQUIRED - 'Your Plugin Name' | 'your-plugin-name'
'adrienpayet.front-comments.repo.labels' => ['bug', 'front-end'], // OPTIONAL - ['label 1', 'label 2'] (Default value is set to ['front-comments']).
]
Use the string notation to set each option individually. Setting the plugins options as an array would overwrite some necessary default options.
_Learn how to create and manage personnal access tokens on GitHub and GitLab._
Use
Add new comments
Logged in users can add comments directly in the front-end by clicking the button located by default in the bottom right corner of the screen. See below how to change its position.
Manage comments though the panel
To view and manage all comments, visit your-website.com/panel/comments
, also is accessible from the default panel menu. To add the comments global view to your custom panel menu, call 'comments' in your /site/config/config.php
:
'panel' => [
'menu' => [
'custom-menu-item' => [...],
'-',
'comments'
'users',
]
]
From this section, you can create and delete comments, as well as create or visit linked issues.
Please note that issues can only be created through this section. However, deleting a comment, whether from the front-end or the panel, will automatically close any linked issues. This ensures that your comments and issues are always synchronized and up-to-date.
Customize
Change the add button position
The default position of the add button is set to bottom right. You can change it by passing a position
property to the snippet :
<?php snippet('front-comments', [
'position' => 'bottom-right' // default position
// alternatives :
'position' => 'bottom-left'
'position' => 'top-left'
'position' => 'top-right'
]) ?>
Troubleshooting
Fix 403 error (rare)
In rare cases, the plugin files may not load due to 403 errors (check the JavaScript console). Fix it by passing a 'location' => 'assets'
property to the snippet:
<?php snippet('front-comments', ['location' => 'assets']) ?>
This will copy the files into /assets/front-comments
, which should resolve the issue.