update + add list_taxonomy

This commit is contained in:
2019-02-21 04:02:36 +01:00
parent 3791a9f435
commit c66917c9a0
13 changed files with 98 additions and 65 deletions
@@ -1,13 +0,0 @@
<ul class="archives">
{% for month,items in archives_data %}
<li>
<a href="{{ base_url }}/{{ config.plugins.archives.taxonomy_names.month }}{{ config.system.param_sep }}{{ month|date('M_Y')|lower|e('url') }}">
{% if archives_show_count %}
<span class="label label-rounded label-primary">{{ items|length }}</span>
{% endif %}
<span class="archive_date">{{ month }}</span>
</a>
</li>
{% endfor %}
</ul>
@@ -1,47 +1,6 @@
{% set feed_url = blog.url == '/' or blog.url == base_url_relative ? (base_url_relative~'/'~blog.slug) : blog.url %}
{% set new_base_url = blog.url == '/' ? '' : blog.url %}
{% if config.plugins.simplesearch.enabled %}
<div class="sidebar-content">
{% include 'partials/simplesearch_searchbox.html.twig' %}
</div>
{% endif %}
{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h4>
{% include 'partials/relatedpages.html.twig' %}
</div>
{% endif %}
{% if config.plugins.random.enabled %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.RANDOM_ARTICLE.HEADLINE'|t }}</h4>
<a class="button" href="{{ base_url }}/random"><i class="fa fa-retweet"></i> {{ 'THEME_QUARK.SIDEBAR.RANDOM_ARTICLE.FEELING_LUCKY'|t }}</a>
</div>
{% endif %}
{{ page.find('/modules/sidebar').content|raw }}
{% if config.plugins.taxonomylist.enabled %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.POPULAR_TAGS.HEADLINE'|t }}</h4>
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
</div>
{% endif %}
{% if config.plugins.archives.enabled %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h4>
{% include 'partials/archives.html.twig' with {'base_url':new_base_url} %}
</div>
{% endif %}
{% if config.plugins.feed.enabled %}
<div class="sidebar-content syndicate">
<h4>{{ 'THEME_QUARK.SIDEBAR.SYNDICATE.HEADLINE'|t }}</h4>
<a class="btn" href="{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
<a class="btn" href="{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a>
{% if config.plugins.feed.enable_json_feed %}<a class="btn" href="{{ feed_url }}.json"><i class="fa fa-rss-square"></i> JSON</a>{% endif %}
</div>
{% endif %}
<div class="sidebar-left">
{% set options = { items: {'@page': '/contact' } } %}
{% set my_collection = page.collection(options) %}
@@ -55,9 +14,11 @@
<div class="sidebar-right">
{% set options = { items: {'@page': '/projets' } } %}
{% set my_collection = page.collection(options) %}
<ul>
{% for p in my_collection %}
<a href="{{p.url}}"><li>{{ p.title }}</li></a>
{% endfor %}
{% include 'partials/taxonomylist.html.twig' with {'base_url': new_base_url, 'taxonomy':'category'} %}
<!-- {% for i in my_collection %}
<li>{{i.title}}</li>
{% endfor %} -->
</ul>
</div>
@@ -1,8 +1,23 @@
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
{% if taxlist %}
<ul>
{% for tax,value in taxlist[taxonomy] %}
{% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %}
{% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %}
<li>
<a class="label {{ label_class }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a>
</li>
{% set options = { items: {'@taxonomy': {'category': tax} } } %}
{% set my_collection = page.collection(options) %}
{% for i in my_collection %}
<li>{{i.title}}</li>
{% endfor %}
{% endfor %}
</ul>
{% endif %}