Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TOC optional #8

Open
bernd-wechner opened this issue Sep 5, 2020 · 0 comments
Open

Make TOC optional #8

bernd-wechner opened this issue Sep 5, 2020 · 0 comments

Comments

@bernd-wechner
Copy link

bernd-wechner commented Sep 5, 2020

I find that, having installed the plugin, on some pages I want a TOC on others not. It's easy enough to wrap all the twig template elements in a conditional:

  {% if meta.TOC %}
    <link rel="stylesheet" href="{{ plugins_url }}/mcb_TableOfContent/style.css">
  {% endif %}

  {% if meta.TOC %}{{ mcb_toc_top | raw }}{% endif %}

  {% if meta.TOC %}{{ mcb_toc | raw }}{% endif %}

But alas the PHP part of the plugin still ends up putting the text of mcb_toc_top_txt after each header. This should ideally not happen if a page doesn't want a TOC of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant