# Using KirbyComments by Jonas Marx

**URL:** <https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543>\
**Category:** Plugins\
**Tags:** v3\
**Created:** [June 16, 2020, 3:27pm UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543 "2020-06-16T15:27:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendrik](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hendrik/32/4591_2.png) [@hendrik](https://forum.getkirby.com/u/hendrik)\
**Post date:** [June 16, 2020, 3:27pm UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/1 "2020-06-16T15:27:36Z")

</div>

Hi everyone, I’m trying to add this comment plugin: [Jonas Marx / KirbyComments · GitLab](https://gitlab.com/rastatux/kirbycomments)

I added the folder as described. Now I would like to insert the form into the corresponding php file. For me this should be this:

```
<?php snippet('head'); ?>

<main id="main" class="main">
  <?php snippet('breadcrumbs');
    snippet('page-header'); ?>

<div class="content clearfix">
  <?php 
    snippet('toc', $page->pagebuilder()->headlinesFromBuilderBlocks());

    // Builder Blocks
    $blocks = $page->pagebuilder()->toBuilderBlocks();
    foreach($blocks as $block):
      snippet('blocks/' . $block->_key(), ['data' => $block]);
    endforeach; 

    snippet('tooltip');
    snippet('share');
    snippet('author');

    // See controller for $section
    if ($section->previousnext()->bool() and $page->depth() > 1) {
      snippet('previous-next'); 
    }
  ?>
</div>

<?php if ($section->submenu()->bool()) {
  snippet('submenu'); 
} ?>
</main>

<?php snippet('footer'); ?>

```

So I changed the middle part like this:

```
snippet('tooltip');
snippet('share');
snippet('author');
        
<div class="comments">
    <?php snippet('comments') ?>
</div>

```

My result looks like this:

> ParseError  
> syntax error, unexpected ‘\<’, expecting end of file

That was an early failure even by my standards. Who can help me?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 16, 2020, 3:56pm UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/2 "2020-06-16T15:56:33Z")

</div>

> [@hendrik](#):
>
> ```auto
> snippet('tooltip');
> snippet('share');
> snippet('author');
> 
> ```

You have to close your php tag after `snippet('author')`, because you start with HTML after that.

---

<div class="post-metadata">

**Author:** ![hendrik](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hendrik/32/4591_2.png) [@hendrik](https://forum.getkirby.com/u/hendrik)\
**Post date:** [June 16, 2020, 4:11pm UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/3 "2020-06-16T16:11:53Z")

</div>

Thanks texnixe. I got it this way:

```
    snippet('tooltip');
    snippet('share');
    snippet('author'); ?>

    <div class="comments">
      <?php snippet('comments') ?>
    </div>

    <?php // See controller for $section
      if ($section->previousnext()->bool() and $page->depth() > 1) {
        snippet('previous-next'); 
    }
  ?>
</div>

```

Now all I have to do is adjust the terrible, unformatted layout. I will get in touch again for sure. :o)

---

<div class="post-metadata">

**Author:** ![hendrik](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hendrik/32/4591_2.png) [@hendrik](https://forum.getkirby.com/u/hendrik)\
**Post date:** [June 16, 2020, 7:10pm UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/4 "2020-06-16T19:10:49Z")

</div>

Hello again,  
As expected, I have two questions:

1. How do I make the form look more appealing than so:  

2. I would have expected the saved comments to be displayed in the panel as the subpage of the respective article. But this is not the case. Did I have wrong expectations or something wrong now?

Oh, as a bonus question: The email notification doesn’t work either. This may be because I don’t know where to put the appropriate command in this file (I put it at the end.):

```
<?php
return [
  'debug' => true,
  'panel' => ['install' => true],
  'sitemap.ignore' => ['error', 'search', 'home/assets'],
  'languages' => false,
  'smartypants' => true,
  'markdown' => [
      'extra' => true,
  ],

  'thumbs' => [

    'driver' => 'gd',
    'quality' => 76,

    'presets' => [
      'xsmall' => ['width' => 300, 'quality' => 76],
      'small' => ['width' => 400, 'quality' => 76],
      'normal' => ['width' => 800, 'quality' => 76],
      'large' => ['width' => 1200, 'quality' => 76],
      'default' => ['width' => 800, 'quality' => 76],
      'columns' => ['width' => 400, 'quality' => 76],
      '3-2' => ['width' => 800, 'height' => 533, 'crop' => 'center', 'quality' => 76],
      '16-9' => ['width' => 800, 'height' => 450, 'crop' => 'center', 'quality' => 76],
      '2-1' => ['width' => 800, 'height' => 400, 'crop' => 'center', 'quality' => 76],
      '3-1' => ['width' => 800, 'height' => 267, 'crop' => 'center', 'quality' => 76]
    ],

    'srcsets' => [

      'default' => [
        '320w' => ['width' => 320, 'quality' => 76],
        '600w' => ['width' => 600, 'quality' => 76],
        '800w' => ['width' => 800, 'quality' => 76],
        '1000w' => ['width' => 1000, 'quality' => 76],
        '1200w' => ['width' => 1200, 'quality' => 76]
      ],

      'small' => [
        '320w' => ['width' => 320, 'quality' => 76],
        '400w' => ['width' => 400, 'quality' => 76],
        '600w' => ['width' => 600, 'quality' => 76]
      ],
      '3-2' => [
        '400w' => ['width' => 400, 'height' => 267, 'quality' => 76, 'crop' => 'center'],
        '600w' => ['width' => 600, 'height' => 400, 'quality' => 76, 'crop' => 'center'],
        '800w' => ['width' => 800, 'height' => 533, 'quality' => 76, 'crop' => 'center'],
        '1000w' => ['width' => 1000, 'height' => 666, 'quality' => 76, 'crop' => 'center'],
        '1200w' => ['width' => 1200, 'height' => 800, 'quality' => 76, 'crop' => 'center']
      ],
      '16-9' => [
        '400w' => ['width' => 400, 'height' => 225, 'quality' => 76, 'crop' => 'center'],
        '600w' => ['width' => 600, 'height' => 338, 'quality' => 76, 'crop' => 'center'],
        '800w' => ['width' => 800, 'height' => 450, 'quality' => 76, 'crop' => 'center'],
        '1000w' => ['width' => 1000, 'height' => 562, 'quality' => 76, 'crop' => 'center'],
        '1200w' => ['width' => 1200, 'height' => 675, 'quality' => 76, 'crop' => 'center']
      ],
      '2-1' => [
        '400w' => ['width' => 400, 'height' => 200, 'quality' => 76, 'crop' => 'center'],
        '600w' => ['width' => 600, 'height' => 300, 'quality' => 76, 'crop' => 'center'],
        '800w' => ['width' => 800, 'height' => 400, 'quality' => 76, 'crop' => 'center'],
        '1000w' => ['width' => 1000, 'height' => 500, 'quality' => 76, 'crop' => 'center'],
        '1200w' => ['width' => 1200, 'height' => 600, 'quality' => 76, 'crop' => 'center']
      ],
      '3-1' => [
        '400w' => ['width' => 400, 'height' => 134, 'quality' => 76, 'crop' => 'center'],
        '600w' => ['width' => 600, 'height' => 200, 'quality' => 76, 'crop' => 'center'],
        '800w' => ['width' => 800, 'height' => 267, 'quality' => 76, 'crop' => 'center'],
        '1000w' => ['width' => 1000, 'height' => 334, 'quality' => 76, 'crop' => 'center'],
        '1200w' => ['width' => 1200, 'height' => 400, 'quality' => 76, 'crop' => 'center']
      ],

    ],
  ],

  'srcset-sizes' => [
    'default' => '(max-width: 671px) 100vw, (max-width: 959px) 63vw, (max-width: 1260px) 65vw',
    'small' => '(max-width: 671px) 400px, 600px',
  ],

  'cache' => [
    'pages' => [
      'active' => false,
        'ignore' => ['search']
    ]
  ],
  'routes' => [
    [
      'pattern' => 'sitemap.xml',
      'action' => function() {
          $pages = site()->pages()->index();
          $ignore = kirby()->option('sitemap.ignore', ['error']);
          $content = snippet('sitemap', compact('pages', 'ignore'), true);
          return new Kirby\Cms\Response($content, 'application/xml');
      }
    ],
    [
      'pattern' => 'sitemap',
      'action' => function() {
        return go('sitemap.xml', 301);
      }
    ]
  ],
  'community.markdown-field.buttons' => [
    'headlines' => [
      'h2', 'h3', 'h4', 'h5', 'h6'
    ], 
    'bold', 
    'italic',
    'code',
    'strikethrough',
    'divider',
    'ul',
    'ol',
    'horizontal-rule',
    'divider',
    'image',
    'file',
    'divider',
    'pagelink',
    'link', 
    'email'
  ],
  'community.markdown-field.font' => [
    'family' => 'sans-serif',
    'scaling' => false,
    'size' => 'regular',
  ],
  'community.markdown-field.blank' => true,
  'community.markdown-field.invisibles' => true,

  'hooks' => [
    'kirbytags:before' => [
      function (string $text = null, array $data = []) {
        return preg_replace_callback('!<(box)>(.*)<\/(box)>!siU', function (array $matches) use ($data) {
          $type = $matches[1];
          $html = '<div class="' . $type . '">';
          $html .= $this->kirbytext($matches[2], $data);
          $html .= '</div>';
          return $html;
        }, $text);
      },
    ]
  ]
];

c::set('comments.email.enabled', true);
c::set('comments.email.to', array('xxx@yyy.net'));
```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 16, 2020, 8:35pm UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/5 "2020-06-16T20:35:32Z")

</div>

> [@hendrik](#):
>
> How do I make the form look more appealing than so:

Use appropriate styles in your stylesheet. Nothing Kirby specific.

> [@hendrik](#):
>
> I would have expected the saved comments to be displayed in the panel as the subpage of the respective article.

Then you have to add a section to your blueprint that lists those comments.

> [@hendrik](#):
>
> ```auto
> c::set('comments.email.enabled', true);
> c::set('comments.email.to', array('xxx@yyy.net'));
> 
> ```

That is Kirby 2 syntax, add those options inside your return array.

There are other comments plugins that are still under development, just saying.

---

<div class="post-metadata">

**Author:** ![hendrik](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hendrik/32/4591_2.png) [@hendrik](https://forum.getkirby.com/u/hendrik)\
**Post date:** [June 18, 2020, 7:00am UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/6 "2020-06-18T07:00:58Z")

</div>

> [@texnixe](#):
>
> There are other comments plugins that are still under development, just saying.

What are the promising candidates here? “Done” doesn’t seem to be one yet, does it?  
How about this one here: [GitHub - mauricerenck/komments: A Kirby 3 comment plugin](https://github.com/mauricerenck/komments)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 18, 2020, 7:07am UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/7 "2020-06-18T07:07:34Z")

</div>

Sorry, I didn’t express myself well, what I really meant was there are other plugins that are still being actively developed.

The Komments plugin is one, but there’s this one as well: [https://github.com/sebastiangreger/kirby3-commentions](https://github.com/sebastiangreger/kirby3-commentions), which I recommend you check out.

---

<div class="post-metadata">

**Author:** ![mauricehh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mauricehh/32/16912_2.png) [@mauricehh](https://forum.getkirby.com/u/mauricehh)\
**Post date:** [June 18, 2020, 10:21am UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/8 "2020-06-18T10:21:08Z")

</div>

Hey,

I built that “komments” plugin, and it comes with some (very) basic styling which works at least for the starterkit. But you should be able to adjust it with some simple css.

It’s working stable and I use it on my site ([https://maurice-renck.de](https://maurice-renck.de)) for some time now. It comes with all the base functionality you might need. And it support webmentions and encrypts email addresses.

---

<div class="post-metadata">

**Author:** ![hendrik](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hendrik/32/4591_2.png) [@hendrik](https://forum.getkirby.com/u/hendrik)\
**Post date:** [June 18, 2020, 10:56am UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/9 "2020-06-18T10:56:27Z")

</div>

Hello Maurice, thanks for reporting. I just tried it on your site.

---

<div class="post-metadata">

**Author:** ![mauricehh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mauricehh/32/16912_2.png) [@mauricehh](https://forum.getkirby.com/u/mauricehh)\
**Post date:** [June 18, 2020, 11:47am UTC](https://forum.getkirby.com/t/using-kirbycomments-by-jonas-marx/18543/10 "2020-06-18T11:47:59Z")

</div>

I answered you over there 😉
