diff --git a/CHANGELOG.md b/CHANGELOG.md index aa81374e..985140b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v2.0.4 +## 09/15/2016 + +1. [](#improved) + * Allow filling the page header form dynamically (e.g. use case: Comments plugin) + # v2.0.3 ## 09/12/2016 diff --git a/blueprints.yaml b/blueprints.yaml index a3ede2ff..55611654 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Form -version: 2.0.3 +version: 2.0.4 description: Enables the forms handling icon: check-square author: diff --git a/form.php b/form.php index 46ee1e02..1fe9bb23 100644 --- a/form.php +++ b/form.php @@ -103,6 +103,11 @@ public function onPageProcessed(Event $e) } $header = $page->header(); + + //call event to allow filling the page header form dynamically (e.g. use case: Comments plugin) + $event = $this->grav->fireEvent('onFormPageHeaderProcessed', new Event(['header' => $header])); + $header = $event->header; + if ((isset($header->forms) && is_array($header->forms)) || (isset($header->form) && is_array($header->form))) {