Skip to content

Commit f2f2f5a

Browse files
committed
TWE-63: Switch PromoBlock.description to RichTextBlock
This will enable editors to use paragraphs (and other formatting options).
1 parent cecaa0f commit f2f2f5a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tbx/core/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ class Meta:
841841

842842
class PromoBlock(blocks.StructBlock):
843843
title = blocks.TextBlock()
844-
description = blocks.TextBlock()
844+
description = blocks.RichTextBlock(features=settings.NO_HEADING_RICH_TEXT_FEATURES)
845845
image = CustomImageChooserBlock()
846846
button_text = blocks.CharBlock(max_length=55)
847847
button_link = blocks.StreamBlock(

tbx/project_styleguide/templates/patterns/molecules/streamfield/blocks/promo_block.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{% load wagtailimages_tags %}
1+
{% load wagtailcore_tags wagtailimages_tags %}
22

33
<div class="grid__promo promo-block">
44
<div class="promo-block__content">
55
{% include "patterns/atoms/section-title/section-title.html" with title=value.title classes="promo-block__title" %}
6-
<p class="promo-block__description">{{ value.description }}</p>
6+
<div class="rich-text promo-block__description">{{ value.description|richtext }}</div>
77
{% if value.button_text %}
88
<a href="{{ value.get_button_link }}" class="button promo-block__button">{{ value.button_text }}</a>
99
{% endif %}

tbx/project_styleguide/templates/patterns/molecules/streamfield/blocks/promo_block.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
context:
22
value:
33
title: This is the title of this generic promo teaser
4-
description: Donec tortor mi, pulvinar non enim et, hendrerit efficitur nisi. Etiam egestas imperdiet purus, faucibus convallis leo pharetra sit amet.
4+
description: |
5+
Donec tortor mi, pulvinar non enim et, hendrerit efficitur nisi. Etiam egestas imperdiet purus, faucibus convallis leo pharetra sit amet.
6+
Sapiente eos et repudiandae amet consequatur.
7+
8+
Fugiat quia eaque enim itaque cupiditate animi blanditiis. Quas at et id magnam impedit.
59
button_text: Call to action
610
get_button_link: '/#'
711
secondary_link:

0 commit comments

Comments
 (0)