Problem with inherited theme

According to the documentation about Config Variable Namespacing the plugin filename is part of the config variable namespace and the filename of the social-media-links plugin includes dashes.

So technically this namespace config.plugins.social-media-links.enabled is correct but as @anon76427325 pointed out will fail because Twig treats each dash as an operator (minus).

Fortunately there’s a solution in Twig as mentioned in the forum post "Test if a plugin is enabled with a plugin name like my-plugin-name.

Changing:
config.plugins.social-media-links.enabled
into:
config.plugins.['social-media-links'].enabled
should do it.

BTW A tour around the official plugins shows that plugins which use Twig never have a dash in their filename.

1 Like