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

Use TOC plugin in template

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

Using the development-branch of the TOC plugin, there is a filter called tocify, which I use like this:

TWIG
{% set toc = page.content|tocify %}
{% include 'partials/toc_default.html.twig' %}

Within {% block content %}, but {{ dump(toc) }} returns nothing. Does anyone have an example of returning the HTML-output from the TOC plugin in a template? I'd like to use it in a sidebar, rather than in the content itself through [TOC].

11 years ago

Excellent, the recipe there worked as expected, thanks for the update.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago