{% extends '@nucleus/partials/particle.html.twig' %} {% set attr_extra = particle.extra|attribute_array %} {% 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 #} {% if filter.articles %} {% set article_options = filter.articles ? {id: [filter.articles|replace({' ': ''})|split(',')]} : {} %} {% set article_finder = joomla.finder('content', article_options).published(1).language() %} {% else %} {% set article_finder = joomla.finder('content').category(categories).published(1).language() %} {% endif %} {% set featured = filter.featured|default('include') %} {% if featured == 'exclude' %} {% do article_finder.featured(false) %} {% elseif featured == 'only' %} {% do article_finder.featured(true) %} {% endif %} {% set start = limit.start + max(0, ajax.start|int) %} {% do article_finder.order(sort.orderby, sort.ordering).limit(limit.total).start(start) %} {% set total = article_finder.count() %} {% set articles = article_finder.find() %} {% block particle %} {# All Articles #}
{% for column in articles|batch(limit.columns) %}
{% for article in column %}
{% if display.edit and article.edit %} {{ 'COM_CONTENT_FORM_EDIT_ARTICLE'|trans }} {% endif %} {% 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' %} {% set cat = article.categories|last %} {% if category_link %} {{ cat.title }} {% else %} {{ cat.title }} {% endif %} {% endif %} {% if display.hits.enabled %} {{ article.hits }} {% endif %}
{% endif %} {% if display.text.type %} {% set article_text = display.text.type == 'intro' ? display.text.prepare ? article.preparedIntroText : article.introtext : display.text.prepare ? article.preparedText : 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 %} {% if total > limit.total and display.pagination_buttons %}
{% endif %}
{% endblock %} {% block javascript_footer %} {% if total > limit.total and display.pagination_buttons %} {% do gantry.load('jquery') %} {% endif %} {% endblock %}