misuzu/templates/news/category.twig

47 lines
1.8 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'news/master.twig' %}
2018-10-22 19:53:21 +00:00
{% from 'macros.twig' import pagination, container_title %}
2018-08-15 01:12:58 +00:00
{% from 'news/macros.twig' import news_preview %}
2018-04-14 02:58:53 +00:00
{% set title = category.category_name ~ ' :: News' %}
{% set manage_link = url_construct('/manage/news.php', {'v':'category','c':category.category_id}) %}
{% set canonical_url = url_construct('/news.php', {
2018-07-07 20:11:16 +00:00
'c': category.category_id,
2019-01-03 00:33:02 +00:00
'p': news_pagination.page > 2 ? news_pagination.page : 0,
2018-07-07 20:11:16 +00:00
}) %}
2018-04-14 02:58:53 +00:00
{% block content %}
<div class="news__container">
<div class="news__preview__listing">
{% for post in posts %}
{{ news_preview(post) }}
{% endfor %}
2018-10-25 00:23:26 +00:00
2019-01-03 00:33:02 +00:00
<div class="container" style="padding: 4px; display: {{ news_pagination.pages > 1 ? 'block' : 'none' }}">
{{ pagination(news_pagination, '/news.php', null, {'c':category.category_id}, 'page') }}
2018-10-25 00:23:26 +00:00
</div>
</div>
<div class="news__sidebar">
<div class="container news__list">
2018-10-22 19:53:21 +00:00
{{ container_title('News » ' ~ category.category_name) }}
<div class="container__content">
{{ category.category_description|length > 0 ? category.category_description : '' }}
</div>
2018-04-16 00:33:54 +00:00
</div>
{% if featured|length > 0 %}
<div class="container news__list">
2018-10-22 19:53:21 +00:00
{{ container_title('Featured Posts') }}
<div class="container__content">
{% for featured_post in featured %}
<a class="news__list__item" href="/news.php?p={{ featured_post.post_id }}">{{ featured_post.post_title }}</a>
{% endfor %}
2018-04-16 00:33:54 +00:00
</div>
</div>
{% endif %}
2018-04-14 02:58:53 +00:00
</div>
</div>
{% endblock %}