{% extends '@nucleus/partials/particle.html.twig' %} {% set attr_extra = '' %} {% if particle.extra %} {% for attributes in particle.extra %} {% for key, value in attributes %} {% set attr_extra = attr_extra ~ ' ' ~ key|e ~ '="' ~ value|e('html_attr') ~ '"' %} {% endfor %} {% endfor %} {% endif %} {% block particle %} {% set article_settings = particle.article %} {% set filter = article_settings.filter %} {% set sort = article_settings.sort %} {% set limit = article_settings.limit %} {% set display = article_settings.display %} {# Category Finder #} {% set category_options = filter.categories ? {id: [filter.categories|split(','), 0]} : {} %} {% set categories = joomla.finder('category', category_options).published(1).language().limit(0).find() %} {# Content Finder #} {% set article_finder = joomla.finder('content').category(categories).published(1).language() %} {% set featured = filter.featured|default('include') %} {% if featured == 'exclude' %} {% do article_finder.featured(false) %} {% elseif featured == 'only' %} {% do article_finder.featured(true) %} {% endif %} {% set articles = article_finder.order(sort.orderby, sort.ordering).limit(limit.total).start(limit.start).find() %} {# All Articles #}
{% for column in articles|batch(limit.columns) %}
{% for article in column %}
{% if display.image.enabled and article.images.image_intro or article.images.image_fulltext %} {% if article.images.image_intro and display.image.enabled == 'intro' or display.image.enabled == 'show' %} {% elseif article.images.image_fulltext and display.image.enabled == 'full' %} {% endif %} {% endif %} {% if display.title.enabled %} {% endif %} {% if display.date.enabled or display.author.enabled or display.category.enabled or display.hits.enabled %}
{% if display.date.enabled %} {% if display.date.enabled == 'published' %} {{ article.publish_up|date(display.date.format) }} {% elseif display.date.enabled == 'modified' %} {{ article.modified|date(display.date.format) }} {% else %} {{ article.created|date(display.date.format) }} {% endif %} {% endif %} {% if display.author.enabled %} {{ article.author.name }} {% endif %} {% if display.category.enabled %} {% set category_link = display.category.enabled == 'link' %} {% for category in article.categories %} {% if category_link %} {{ category.title }} {% else %} {{ category.title }} {% endif %} {% endfor %} {% endif %} {% if display.hits.enabled %} {{ article.hits }} {% endif %}
{% endif %} {% if display.text.type %} {% set article_text = display.text.type == 'intro' ? article.introtext : article.text %}
{% if display.text.formatting == 'text' %} {{ article_text|truncate_text(display.text.limit)|raw }} {% else %} {{ article_text|truncate_html(display.text.limit)|raw }} {% endif %}
{% endif %} {% if display.read_more.enabled %} {% endif %}
{% endfor %}
{% endfor %}
{% endblock %}