Closed lollita closed 6 years ago
Hi, what are you trying to achieve here about pico-pages-list
?
You can use conditions in twig, but the setting you target isn't valid.
I know it but is the which target valid?
I'm not the author of PicoFilePrefixes
, but it seems that you trying to target AbstractPicoPlugin::$enabled
. It's not a config setting, and I don't think Pico let you access that from Twig.
You should look/ask at Pico issues directly if there is a way to know from Twig if a plugin is enabled.
ok
i wrong to write
not : {% if config.PicoFilePrefixes.enabled %}
but : {% if config.PicoPagesList.enabled %}
Note that if there is no "official" way to do it, you could set the following setting :
$config['PicoPagesList.enabled'] = true;
And target that on your theme using an array syntax :
{% if config['PicoPagesList.enabled'] %}
i tryed it but not work.
Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "exclude" filter.'
do it work for you?
This error is related to a theme calling PicoPagesList-specific features (exclude
filter here) while PicoPagesList is missing or disabled.
Are you trying to make a theme with an optional PicoPagesList support ? Working example :
{% if config['PicoPagesList.enabled'] %}
{% include 'picopageslist-navigation.twig' %}
{% endif %}
if i set $config[ 'PicoPagesList.enabled' ] = false and use {% if config['PicoPagesList.enabled'] %} the condition return true and theme not work
but
if i set //$config[ 'PicoPagesList.enabled' ] = false and use {% if config['PicoPagesList.enabled'] %} the condition return false and theme work
You seems to have a typo again, this is PicoPagesList
instead of PicoPlacing
.
Please copy directly the related parts in your theme and config.php
.
excuse me, i have wrong to copy and past but the way remains unchanged. I corrected the post.
I cannot reproduce that behavior, sorry.
If this setting and the twig part are set correctly and not overrided, there is no reason I can think of for $config['PicoPagesList.enabled'] = false;
to return true
in your theme.
Feel free to share your Pico version and copy your template and config files.
Is it possible to use such a condition in twig? ex.