-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update homepage template to include new content
- Loading branch information
Showing
3 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.simple_tag | ||
def get_featured_pages(page_blocks): | ||
featured_pages = [block.value for block in page_blocks] | ||
return featured_pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% load static wagtailcore_tags card_tags generic_tags content_tags %} | ||
|
||
{% get_featured_pages self.featured_pages as featured_pages %} | ||
{% with related_pages=featured_pages heading=self.featured_work_heading %} | ||
{% if self.featured_pages|length == 1 %} | ||
{% include 'home/includes/featured_page.html' %} | ||
{% else %} | ||
{% include 'includes/partials/related_content.html' %} | ||
{% endif %} | ||
{% endwith %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters