{% extends 'global/master.tpl' %} {% set newsPosts = viewPost and postExists ? [news.getPost(postExists)] : news.getPosts(postsPerPage)[currentPage] %} {% set pagination = {'page': currentPage, 'pages': news.getPosts(postsPerPage), 'urlPattern': 'SITE_NEWS_PAGE'} %} {% if viewPost and postExists %} {% set commentsCategory = 'news-' ~ newsPosts[0].category ~ '-' ~ newsPosts[0].id %} {% set comments = newsPosts[0].comments.comments %} {% endif %} {% set title %} {% if not (viewPost ? postExists : newsPosts|length) %}Post does not exist!{% elseif viewPost and postExists %}{{ newsPosts[0].title }}{% else %}News{% endif %} {% endset %} {% block title %}{{ title }}{% endblock %} {% block css %} {% endblock %} {% block content %}
{{ title }}{% if not (viewPost and postExists) %}{% endif %}
{% if (viewPost ? postExists : newsPosts|length) %} {% for post in newsPosts %} {% include 'elements/newsPost.tpl' %} {% if viewPost and postExists %} {% include 'elements/comments.tpl' %} {% endif %} {% endfor %} {% if not (viewPost and postExists) and news.getPosts(postsPerPage)|length > 1 %}
{% include 'elements/pagination.tpl' %}
{% endif %} {% else %}

The requested news post does not exist!

There are a few possible reasons for this;
  • The post may have been deleted due to irrelevancy.
  • The post never existed.
{% endif %}
{% endblock %}