push-eax / pico-comments

A comments plugin for Pico CMS
MIT License
8 stars 3 forks source link

Solved : Add instructions for 'Add comment submission forms and rendering macros to your theme' #5

Open ABelliqueux opened 2 years ago

ABelliqueux commented 2 years ago

Hi, this looks promising but I couldn't figure out how to achieve step 3 of the instructions :

  1. Add comment submission forms and rendering macros to your theme

I realize comments.twig contains a sample macro but couldn't figure out how to add it to my theme's index.twig.

Here is what I did so far:

FWIW, using Pico 2.1.4 / PHP 7.3

Can someone shed a light please ?

EDIT: Found the solution with the help from https://github.com/push-eax/pico-comments/issues/2#issuecomment-823636246 ;

So, step 3 instructions are :

3.a Put the comments.twig file in your theme's folder, e.g pico/themes/default;

pico
  └─ themes
        └─ default
              ├── [...]
              └── comments.twig

3.b Edit comments.twig and replace line 53 :

    {{ print_comments(comments, false) }}

with

    {{ _self.print_comments(comments, false) }}

3.c In your index.twig file, add the following twig instruction :

{{ include('comments.twig') }}

where you want the form to appear.

ABelliqueux commented 2 years ago

Addressed in pull request https://github.com/push-eax/pico-comments/pull/6

Fixed fork is at https://github.com/ABelliqueux/pico-comments