Add tag list button to post list hero

This commit is contained in:
Jake Howard 2022-10-29 13:22:21 +01:00
parent 0544f7541b
commit a031adefda
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 11 additions and 0 deletions

View file

@ -43,6 +43,10 @@ class BlogPostListPage(BaseListingPage):
return BlogPostPageFeed return BlogPostPageFeed
@cached_property
def tag_list_page_url(self) -> Optional[str]:
return SingletonPageCache.get_url(BlogPostTagListPage)
class BlogPostPage(BaseContentPage): class BlogPostPage(BaseContentPage):
subpage_types: list[Any] = [] subpage_types: list[Any] = []

View file

@ -1,5 +1,12 @@
{% extends "common/listing_page.html" %} {% extends "common/listing_page.html" %}
{% load wagtailroutablepage_tags %}
{% block hero_buttons %}
<a class="button is-radiusless" href="{{ page.tag_list_page_url }}" title="View tags"><i class="fas fa-tags" aria-hidden="true"></i></a>
{{ block.super }}
{% endblock %}
{% block post_content %} {% block post_content %}
<section class="container"> <section class="container">
{% for page in listing_pages %} {% for page in listing_pages %}