{% extends 'base.html.twig' %} {% set pageTitle = "blogs"|trans|title %} {% block stylesheets %} {% endblock %} {% set tags = getBlogTags(app.request) %} {% block content %} {% include "components/_intro.html.twig" with {options: { title: "blogs_intro_title"|trans|title, skip: ".blog-wrapper", img: false, skip: false }} %}
{% include 'components/_blog-search.html.twig' %}
{% set page = app.request.get('page') %} {% set query = app.request.get('s') %} {% set tags = app.request.get('tags') %} {% set allBlogs = getBlogs({'page': page, 'query': query, 'tags': tags}, app.request) %} {% set mainBlog = allBlogs["mainBlog"] %} {% set blogs = allBlogs["blogs"] %} {% set pageCount = allBlogs["pageCount"] %} {% set search = app.request.get('s') %} {% set filterTags = app.request.get('tags') %}
{% if (mainBlog is not defined or not mainBlog) and (blogs|length) == 0 %} {{"blog_not_found"|trans|capitalize}} {% else %} {% if mainBlog is defined and mainBlog %} {% include 'components/_blog-item.html.twig' with {type: "main", blog: mainBlog} %} {% endif %} {% for blog in blogs %} {% include 'components/_blog-item.html.twig' with {blog: blog} %} {% endfor %} {% endif %}
{% if not page %}{% set page = 1 %}{% endif %} {% set page = page|number_format %} {% if page != 1 %} {{"back"|trans|title}} 0{{page-1}} {% endif %}
0{{page}}
{% if page != 9 and page < pageCount %} 0{{page+1}} {{"next"|trans|title}} {% endif %}
{% endblock %}