-
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.
TWE-16 - BE - Optional intro & button fields for blog/work chooser bl…
…ocks (#339) * Add intro to BlogChooserBlock * Add intro to WorkChooserBlock * Comment out intro from pattern library for now * Add primary & secondary buttons also, commented out from the YAML file * Add comments we only expect 1 button
- Loading branch information
1 parent
0954671
commit f8a6e88
Showing
5 changed files
with
67 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
...roject_styleguide/templates/patterns/molecules/streamfield/blocks/blog_chooser_block.html
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 |
---|---|---|
@@ -1,15 +1,34 @@ | ||
{% load wagtailcore_tags %} | ||
|
||
{# Section heading #} | ||
{% if is_standard_page %} | ||
<h2 class="heading heading--two-b heading--light grid__heading mb-spacerMedium">{{ value.featured_blog_heading }}</h2> | ||
{% else %} | ||
{% include "patterns/atoms/motif-heading/motif-heading.html" with heading_level=2 heading=value.featured_blog_heading classes="motif-heading--two motif-heading--static motif-heading--half-width section-title--related-posts" %} | ||
{% endif %} | ||
|
||
{# Section intro #} | ||
{% if value.intro %} | ||
<div class="rich-text"> | ||
{{ value.intro|richtext }} | ||
</div> | ||
{% endif %} | ||
|
||
{# Blog posts #} | ||
<ul class="grid__related-posts streamfield__related-posts mb-spacerMedium lg:mb-spacerLarge"> | ||
{% for blog_page in value.blog_pages %} | ||
{% pageurl blog_page.blog_index as blog_index_url %} | ||
{% pageurl blog_page as blog_post_url %} | ||
{% include "patterns/molecules/listing/listing--avatar.html" with title=blog_page.title name=blog_page.first_author.name job_title=blog_page.first_author.role link=blog_post_url date=blog_page.date reading_time=blog_page.read_time tags=blog_page.tags avatar=blog_page.first_author.image tag_link_base=blog_index_url %} | ||
{% endfor %} | ||
</ul> | ||
|
||
{# We expect only up to 1 primary button (`max_num=1` is set in the block definition.) #} | ||
{% for button in value.primary_button %} | ||
<a href="{{ button.value.url }}">{{ button.value.text }}</a> | ||
{% endfor %} | ||
|
||
{# We expect only up to 1 secondary button (`max_num=1` is set in the block definition.) #} | ||
{% for button in value.secondary_button %} | ||
<a href="{{ button.value.url }}">{{ button.value.text }}</a> | ||
{% endfor %} |
11 changes: 10 additions & 1 deletion
11
...roject_styleguide/templates/patterns/molecules/streamfield/blocks/blog_chooser_block.yaml
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
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
9 changes: 9 additions & 0 deletions
9
...roject_styleguide/templates/patterns/molecules/streamfield/blocks/work_chooser_block.yaml
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