Handling Related Articles¶

Listing a collection of Related Articles¶

Usage:

1
2
3
4
5
6
7
8
<ul>
{% gimmelist relatedArticle from relatedArticles with { article: gimme.article }} %}
    <li>{{ relatedArticle.article.title }}</li> <!-- Related article's title -->
    <a href="{{ url(relatedArticle.article) }}">Link</a> <!-- Related article's URL -->
    <li>{{ relatedArticle.createdAt|date('Y-m-d') }}</li> <!-- Related article's creation date -->
    <li>{{ relatedArticle.updatedAt|date('Y-m-d') }}</li> <!-- Related article's update date -->
{% endgimmelist %}
</ul>

The above twig code, will render the list of related articles by given article in with parameters.

The {{ relatedArticle.article }} object is an article object.

Specifying article parameter is optional. By default the article from context will be loaded.

Logo

Publisher

  • Manual
    • Introduction
    • Getting started
    • Templates System
      • Rendering pages with Twig
      • Creating a page templates
      • Creating custom templates
      • Properties
      • Templates features
      • Handling Articles
      • Handling Related Articles
      • Handling Article Media
      • Handling Article Authors
      • Handling Article Slideshows
      • Handling Routes
      • Handling Content List Items
      • Keywords
      • Template Caching
      • How to implement Search using ElasticSearch?
      • Tips
      • Templates inheritance
      • How to change the Route/Article template name?
    • Themes
    • Editorial tools
    • Admin Interface
  • Cookbooks
  • Reference
  • Bundles
  • Developer Guide

Related Topics

  • Documentation overview
    • Manual
      • Templates System
        • Previous: Handling Articles
        • Next: Handling Article Media

Quick search

©2018, Sourcefabric z.ú. | Powered by Sphinx 1.8.6 & Alabaster 0.7.12 | Page source