1

I made a custom theme setting:

'#default_value' => theme_get_setting('my_custom_theme_setting'),

I created a variable so I can use it:

$variables['theme_my_custom_theme_setting'] = theme_get_setting('my_custom_theme_setting');

Now I try to use it in my twig file menu--main.html.twig:

{%
        set classes = [
          'nav-item',
          item.is_expanded and theme_my_custom_theme_setting ? 'expanded',
        ]
      %}

But I don't see any result? Is it possible to have multiple condition in set classes like item.is_expanded and theme_my_custom_theme_setting ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.