Closed dorb4n closed 3 years ago
you need to enable that feature in the compile flags. https://github.com/bnomei/kirby3-handlebars/wiki/Handlebars:-Templates#settings
https://github.com/zordius/lightncandy#detail-feature-list
{{>file foo bar=another}} : partial with new context which mixed with followed key value (require FLAG_RUNTIMEPARTIAL)
see defaults: https://github.com/bnomei/kirby3-handlebars/blob/f1f45f627392a6d86792efc728652f21612bd9e5/index.php#L8
site/config/config.php
<?php
return [
'bnomei.handlebars.compile-flags' => function () {
// https://zordius.github.io/HandlebarsCookbook/9900-lc-options.html
return \LightnCandy\LightnCandy::FLAG_ELSE
| \LightnCandy\LightnCandy::FLAG_NOESCAPE
// | \LightnCandy\LightnCandy::FLAG_PARENT
| \LightnCandy\LightnCandy::FLAG_RUNTIMEPARTIAL // <-- uncommented from defaults
// | \LightnCandy\LightnCandy::FLAG_NAMEDARG
;
},
// other options
];
Thank you :+1: Works great.
Hi.
Is it possible to pass custom variables to a partial, like:
{{> @link url=navigation_url class=navigation_class}}
link
andclass
is in the link partial. When i try this, i get following error:Bnomei\LncFiles::precompiledTemplate(): Return value must be of type string, bool returned
navigation_class
andnavigation_url
are strings.