<section id="menu">
  {% if config.plugins.simplesearch.enabled %}
    <!-- Search -->
    <section>
      {% include 'partials/simplesearch_searchbox_sidebar.html.twig' %}
    </section>
  {% endif %}
  <!-- Links -->
  <section id="sidebarmenu">
    {% include 'partials/sidebar_navigation.html.twig' %}
  </section>
  {% if config.plugins.archives.enabled %}
    <!-- Actions -->
    <section>
      <header>
        <h3>{{ 'FUTURE.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h3>
      </header>
      {% include 'partials/archives.html.twig' %}
    </section>
  {% endif %}
  {% if config.plugins.relatedpages.enabled %}
    <section>
      <header>
        <h3>{{ 'FUTURE.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h3>
      </header>
      {% include 'partials/relatedpages.html.twig' %}
    </section>
  {% endif %}
  {% if config.plugins.taxonomylist.enabled %}
    <section>
      <header>
        <h3>{{ 'FUTURE.SIDEBAR.TAGS.HEADLINE'|t }}</h3>
      </header>
      {% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
    </section>
  {% endif %}
  {% if config.plugins.login.enabled %}
    <section>
      <ul class="actions stacked">
        <li><a href="#" class="button large fit">{{ 'FUTURE.LOGIN'|t }}</a></li>
      </ul>
    </section>
  {% endif %}
</section>
<script>
  {% if p.routable == false and p.children.count > 0 %}
    $(".subitem_hide").hide(); // this hides the list initially
    $(".dropdown-btn").click(function () {
      $(this).next(".subitem_hide").slideToggle();
    });
  {% else %}
    $(".subitem").attr("style", "display:block"); // this shows the list if it is routable
    $(".dropdown-btn").click(function () {
      $(this).next(".subitem_hide").slideToggle();
    });
  {% endif %}
</script>
