From 4089e47e14edb1e7cfb99903a64041681c8902cf Mon Sep 17 00:00:00 2001 From: "pmoreno.rodriguez" Date: Fri, 29 Sep 2023 13:59:33 +0200 Subject: [PATCH] New template for Page Toc plugin compatibility --- templates/components/page-toc.html.twig | 25 +++++++++++++++++++++++ templates/partials/sidebar_left.html.twig | 19 +++++++++-------- 2 files changed, 35 insertions(+), 9 deletions(-) create mode 100755 templates/components/page-toc.html.twig diff --git a/templates/components/page-toc.html.twig b/templates/components/page-toc.html.twig new file mode 100755 index 0000000..33e952c --- /dev/null +++ b/templates/components/page-toc.html.twig @@ -0,0 +1,25 @@ +{% macro toc_loop(items) %} + {% for item in items %} + {% set class = loop.first ? 'first' : loop.last ? 'last' : null %} +
  • + {{ item.label }} + {% if item.children|length > 0 %} + + {% endif %} +
  • + {% endfor %} +{% endmacro %} + +{% if active or toc_config_var('active') %} +
    + {% set table_of_contents = toc_items(page.content) %} + {% if table_of_contents is not empty %} +

    {{ 'PLUGIN_PAGE_TOC.TABLE_OF_CONTENTS'|t }}

    + + {% endif %} +
    +{% endif %} \ No newline at end of file diff --git a/templates/partials/sidebar_left.html.twig b/templates/partials/sidebar_left.html.twig index 71826ab..4bf2d0f 100755 --- a/templates/partials/sidebar_left.html.twig +++ b/templates/partials/sidebar_left.html.twig @@ -13,17 +13,18 @@ {% endblock %} {% block footer %} - - {% if theme_config.footer.title or theme_config.footer.description %} -
    -

    {{theme_config.footer.title}}

    -

    {{theme_config.footer.description}}

    - -
    + + {% if page.header.toc_enabled == true and config.plugins["page-toc"].enabled %} +
    + {% include 'components/page-toc.html.twig' %} {% endif %} + {% include 'partials/sidebar-bits/footer.html.twig' %} + + {% if page.header.toc_enabled == true and config.plugins["page-toc"].enabled %} +
    + {% endif %} + {% endblock %}