From d74d0d0b2d8b66ba7bf84e84d7d99d3a93fa2689 Mon Sep 17 00:00:00 2001 From: lupyana Date: Mon, 20 Oct 2025 14:39:17 +0300 Subject: [PATCH] implement wagtailpagecache example - added wagtail cache example to the full blog post view --- bakerydemo/templates/blog/blog_page.html | 47 ++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/bakerydemo/templates/blog/blog_page.html b/bakerydemo/templates/blog/blog_page.html index 0254ed7c9..e57b5ab47 100644 --- a/bakerydemo/templates/blog/blog_page.html +++ b/bakerydemo/templates/blog/blog_page.html @@ -1,36 +1,37 @@ {% extends "base.html" %} -{% load navigation_tags wagtailimages_tags %} +{% load navigation_tags wagtailimages_tags wagtail_cache %} {% block content %} {% include "base/include/header-blog.html" %} + {% wagtailpagecache 500 page %} +
+
+
+
+ {% if page.authors %} +
+ {% for author in page.authors %} +
{% picture author.image format-{avif,webp,jpeg} fill-50x50-c100 class="blog__avatar" %} + {{ author.first_name }} {{ author.last_name }}
+ {% endfor %} +
+ {% endif %} +
+ + {{ page.body }} -
-
-
-
- {% if page.authors %} -
- {% for author in page.authors %} -
{% picture author.image format-{avif,webp,jpeg} fill-50x50-c100 class="blog__avatar" %} - {{ author.first_name }} {{ author.last_name }}
+ {% if page.get_tags %} +

Find more blog posts with similar tags

+
+ Filter blog posts by tag + {% for tag in page.get_tags %} + {{ tag }} {% endfor %}
{% endif %}
- - {{ page.body }} - - {% if page.get_tags %} -

Find more blog posts with similar tags

-
- Filter blog posts by tag - {% for tag in page.get_tags %} - {{ tag }} - {% endfor %} -
- {% endif %}
-
+ {% endwagtailpagecache %} {% endblock content %}