Skip to content

Active comments per page in the frontmatter #93

@NicoHood

Description

@NicoHood

I am trying to only active the comments function when to active flag in the frontmatter is set. This is not yet implemented and I think this might not be possible at all. It would be nice, if you could give me some hints:

  1. onPluginsInitialized Event will check if the route is set in the config and enables the plugin
  2. onFormPageHeaderProcessed Adds the form to the page header
  3. onPageInitialized Gives us the page object along with its header settings

The problem is, that I must check if the plugin should be enabled in step 3. But I cannot add the form from step 1 at this late step. This means I can only enable/disable the comments plugin from uris?

Enabling the plugin on a per-page basis has multiple usecases:

  • You dont need to edit the plugin config every time, just the page
  • You do not need to use uris, which might change
  • You can also enable comments for a special page template, e.g. only for blog posts, no matter at which route they are
  • This plugin will only be active, where is should. currently you can send a POST to a page without comments form and a comment will be silently added to the data directory

Is there a way to add a form to the page header at a later time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions