Skip to content

Commit

Permalink
order index page entries by most-recently-created (#3467)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax authored and alanmoo committed Jul 29, 2019
1 parent 64f78ca commit 6dc6217
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions network-api/networkapi/wagtailpages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ def get_context(self, request):
context = super().get_context(request)
context = set_main_site_nav_information(self, context, 'Homepage')
context = get_page_tree_information(self, context)
context['entries'] = self.get_children().live().order_by('-first_published_at')
return context


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 class="h1-heading mb-0 mt-1 pt-2">
<div class="row">
{% block subcontent %}

{% for entry in page.get_children.live %}
{% for entry in entries %}
{% with type=entry.specific_class.get_verbose_name|lower %}
{% if type == "blog page" %}
{% include "./fragments/blog-card.html" with page=entry %}
Expand Down

0 comments on commit 6dc6217

Please sign in to comment.