{% extends "base.html" %} {% load wagtailcore_tags static %} {% block content %}

Page Settings

Theme: {{ page.theme }}

Layout: {{ page.layout }}

These settings were chosen using ThumbnailRadioSelect widgets in the Wagtail admin!

Directory Icon

{% if page.directory_icon %} {% get_static_prefix as STATIC_PREFIX %}
{{ page.directory_icon }}

Selected: {{ page.directory_icon }}

{% else %}

No icon selected — edit the page to pick one from the directory picker.

{% endif %}

Icons scanned automatically from static/icons/

{% for block in page.content %} {% if block.block_type == 'heading' %}

{{ block.value }}

{% elif block.block_type == 'paragraph' %}
{{ block.value|richtext }}
{% elif block.block_type == 'icon_block' %}

Icon Block

{% include "home/icons/inline/"|add:block.value.icon|add:".html" %} {{ block.value.text|default:"" }}
{% elif block.block_type == 'color_scheme' %}

Color Scheme Block

{% if block.value.title %}

{{ block.value.title }}

{% endif %} {% if block.value.content %}

{{ block.value.content }}

{% endif %}

Selected scheme: {{ block.value.scheme }}

{% elif block.block_type == 'button_style' %}

Button Style Block

{{ block.value.text }}

Style: {{ block.value.style }}

{% elif block.block_type == 'optional_icon' %}

Optional Icon Block (required=False)

{% if block.value.icon %}
{% include "home/icons/inline/"|add:block.value.icon|add:".html" %}
{% else %}
No icon selected
{% endif %}

{{ block.value.heading }}

Icon field is optional - can be left blank

{% elif block.block_type == 'required_icon' %}

Required Icon Block (required=True)

{% include "home/icons/inline/"|add:block.value.icon|add:".html" %}

{{ block.value.heading }}

Icon field is required - must select an icon

{% elif block.block_type == 'one_color_icon_image' %}

One-Color Icon Block (image-based)

{% get_static_prefix as STATIC_PREFIX %} {% if block.value.icon == 'right' %} {{ block.value.icon }} {% else %} {{ block.value.icon }} {% endif %} {{ block.value.text|default:"" }}

thumbnail_is_one_color=True (image-based)

{% elif block.block_type == 'one_color_icon_template' %}

One-Color Icon Block (template-based)

{% include "home/icons/inline/"|add:block.value.icon|add:".html" %} {{ block.value.text|default:"" }}

thumbnail_is_one_color=True (template-based) — in the Wagtail admin, this template's fill="currentColor" SVG is tinted to match the surrounding text color. Here on the front end it just renders as authored, with no tinting applied.

{% elif block.block_type == 'directory_icon' %}

Directory Icon Block

{% if block.value %}
{% get_static_prefix as STATIC_PREFIX %} {{ block.value }}

Selected: {{ block.value }}

{% else %}

No icon selected

{% endif %}

Icons loaded automatically from static/icons/

{% endif %} {% endfor %}
{% if not page.content %}

Welcome!

This is a demo of the Wagtail Thumbnail Choice Block. To see it in action:

  1. Go to the Wagtail admin at /admin/
  2. Edit this page
  3. Try changing the Theme and Layout settings
  4. Add content blocks with various thumbnail choice options
{% endif %} {% endblock %}