Skip to content

Commit

Permalink
Order feature work pages by latest published date
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatcherK committed Nov 20, 2023
1 parent b39f672 commit d74d93f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions di_website/home/templatetags/content_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@

@register.simple_tag
def get_featured_pages(page_blocks):
featured_pages = [block.value for block in page_blocks]
return featured_pages
featured_pages = [block.value for block in page_blocks if block.value.live]
ordered_featured_pages = sorted(featured_pages, key=lambda x:
getattr(x.specific, 'publication_date',
None), reverse=True)
return ordered_featured_pages

0 comments on commit d74d93f

Please sign in to comment.