https://github.com/afbora/kirby-template-hooks
Enable page and file template hooks for Kirby 3
https://github.com/afbora/kirby-template-hooks
hooks kirby kirby-cms kirby-extension kirby-plugin kirby3-plugin
Last synced: 3 months ago
JSON representation
Enable page and file template hooks for Kirby 3
- Host: GitHub
- URL: https://github.com/afbora/kirby-template-hooks
- Owner: afbora
- License: mit
- Created: 2019-08-06T07:07:54.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T18:07:24.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T09:47:51.384Z (4 months ago)
- Topics: hooks, kirby, kirby-cms, kirby-extension, kirby-plugin, kirby3-plugin
- Language: PHP
- Size: 10.7 KB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Kirby Template Hooks
Kirby template hooks allow you to manage hooks for page and file templates more easily.
## Installation
### Installation with composer
```ssh
composer require afbora/kirby-template-hooks
```### Add as git submodule
```ssh
git submodule add https://github.com/afbora/kirby-template-hooks.git site/plugins/kirby-template-hooks
```## Usage
### Pages
**Usage:** `page.TEMPLATE_NAME.ACTION_NAME:before/after`
```php
[
'page.product.update:after' => function ($newPage, $oldPage) {
// your code goes here
}
]
];```
### Files
**Usage:** `file.TEMPLATE_NAME.ACTION_NAME:before/after`
```php
[
'file.cover.update:after' => function ($newFile, $oldFile) {
// your code goes here
}
]
];```