misuzu/templates/news/category.twig

46 lines
1.6 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'news/master.twig' %}
{% from 'macros.twig' import pagination %}
{% from 'news/macros.twig' import news_preview %}
2018-04-14 02:58:53 +00:00
{% set title = category.category_name ~ ' :: News' %}
2018-07-07 20:11:16 +00:00
{% set canonical_url = '/news.php'|url_construct({
'c': category.category_id,
'o': posts_offset,
}) %}
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 %}
</div>
<div class="news__sidebar">
<div class="container news__list">
<div class="container__title news__container__title">
News » {{ category.category_name }}
</div>
<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">
<div class="container__title">
Featured Posts
2018-04-14 02:58:53 +00:00
</div>
<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 %}
{{ pagination(category.posts_count, posts_take, posts_offset, '/news.php?c=' ~ category.category_id) }}
2018-04-14 02:58:53 +00:00
</div>
</div>
{% endblock %}