Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 7 days 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 (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T18:07:24.000Z (over 1 year ago)
- Last Synced: 2024-10-01T09:40:04.191Z (about 1 month ago)
- Topics: hooks, kirby, kirby-cms, kirby-extension, kirby-plugin, kirby3-plugin
- Language: PHP
- Size: 10.7 KB
- Stars: 15
- Watchers: 2
- 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
}
]
];```