Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Activate plugin by template

Started by Muut Archive 11 years ago · 2 replies · 201 views
11 years ago

I would like to activate the TOC plugin only on pages based on a specific twig template. Is there a way to set a configuration setting through a template?

11 years ago

Hi @cord,

well I'd like to know it, too. But even when setting a configuration option via a template is possible, changing values in Twig is far too late for this plugin (either it is loaded and active or it is disabled completely). If nothing helps, I can add an option maybe, which makes it possible (i.e loads Toc but don't process pages). Then you can use the Twig filter to do it in your template...

But I'd like to know whether there are other solutions :-)

11 years ago

would it be possible to have a white / black list by route? otherwise an option to process the plugin later would work as well I think.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1338 9 years ago
Archive · by Muut Archive, 9 years ago
2 927 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago