1- # Kirby Conditional Snippets
1+ ![ Kirby snippetWhen Helper ] ( .github/title.png )
22
3- Helper function for Kirby to embed snippets only when a condition is met .
3+ ** snippetWhen ** is a helper function for [ Kirby 3 ] ( https://getkirby.com ) to conditionally embed snippets.
44
55## Installation
66
@@ -20,23 +20,22 @@ git submodule add https://github.com/hananils/kirby-snippetwhen-helper.git site/
2020composer require hananils/kirby-snippetwhen-helper
2121```
2222
23- ## Usage
23+ # Usage
2424
25- ### snippetWhen($snippet, $condition, $expected, $data)
25+ ## snippetWhen($snippet, $condition, $expected, $data)
2626
27- - ` $snippet ` : the name of the snippet
28- - ` $condition ` : a condition that either evaluates to ` true ` or ` false `
29- - ` $expected ` : the expected result of the condition, defaults to ` true `
30- - ` $data ` : data object passed to the snippet
27+ Conditionally embeds a snippet:
28+
29+ - ** ` $snippet ` :** the name of the snippet
30+ - ** ` $condition ` :** a condition that either evaluates to ` true ` or ` false `
31+ - ** ` $expected ` :** the expected result of the condition, defaults to ` true `
32+ - ** ` $data ` :** data object passed to the snippet
3133
3234``` php
33- snippetWhen('article', $page->category()->isNotEmpty())
35+ snippetWhen('article', $page->category()->isNotEmpty());
3436```
3537
36- ## License
37-
38- MIT
39-
40- ## Credits
38+ # License
4139
42- - hana+nils · Büro für Gestaltung
40+ This plugin is provided freely under the [ MIT license] ( LICENSE.md ) by [ hana+nils · Büro für Gestaltung] ( https://hananils.de ) .
41+ We create visual designs for digital and analog media.
0 commit comments