Преглед на файлове

Sort articles in the related posts section by date in ascending order

I think ascending is better. This way older article will appear on top
of the list. Recent related articles may already appear in recent posts
section. You need to bubble up older articles.
Talha Mansoor преди 11 години
родител
ревизия
bb21f4b13b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      templates/_includes/related_posts.html

+ 1 - 1
templates/_includes/related_posts.html

@@ -3,7 +3,7 @@
 <section>
     <h2>{{ RELATED_POSTS_LABEL }}</h2>
 <ul class="related-posts-list">
-{% for related_post in article.related_posts %}
+{% for related_post in article.related_posts|sort(attribute = 'date') %}
     {% set title = related_post.title|striptags %}
     {% set htitle = title %}
     {%if related_post.subtitle %}