Handling Articles

Listing Articles

Publisher have concept of Meta Loaders - one of built in loaders covers articles.

The articles loader parameters:

  • (optional) key route - id or name or array of id’s used for loading meta (if omitted then current route is used).
1
2
3
{% gimmelist article from articles %} <!-- It will use route from context -->
    <img src="{{ url(article) }}" />
{% endgimmelist %}
1
2
3
{% gimmelist article from articles with {'route': 1} %} <!-- route id -->
    <img src="{{ url(article) }}" />
{% endgimmelist %}
1
2
3
{% gimmelist article from articles with {'route': '/news'} %} <!-- route name -->
    <img src="{{ url(article) }}" />
{% endgimmelist %}
1
2
3
4
5
   {% gimmelist article from articles with {'route': [1, 2, 3]} %} <!-- array with routes id -->
       <img src="{{ url(article) }}" />
   {% endgimmelist %}

* (optional) key :code:`metadata` - It matches article’s metadata, and you can use all metadata fields that are defined for the article, i.e.: language, located etc.
1
2
3
{% gimmelist article from articles with {'metadata':{'language':'en'}} %}
    <img src="{{ url(article) }}" />
{% endgimmelist %}
  • (optional) key keywords - It matches article’s keywords,

    {% gimmelist article from articles with {‘keywords’:[‘keyword1’, ‘keyword2’]} %}

    <img src=”{{ url(article) }}” />

    {% endgimmelist %}