-
Notifications
You must be signed in to change notification settings - Fork 3
TWE-667 | Blog page updates #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
363a425
4756666
480360c
6390947
257c9a3
764b5e4
1be005b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Generated by Django 5.2.5 on 2025-10-22 09:34 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
| import tbx.core.utils.fields | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("blog", "0029_relatedblogpage"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="blogindexpage", | ||
| name="introduction", | ||
| field=models.TextField(blank=True), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="blogindexpage", | ||
| name="page_links", | ||
| field=tbx.core.utils.fields.StreamField( | ||
| blank=True, block_lookup={}, help_text="Add up to 3 styled page links." | ||
| ), | ||
| ), | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {% load wagtailcore_tags %} | ||
|
|
||
| <a href="{% pageurl value.page %}" class="button styled-page-links__button styled-page-links__button--{{ value.style }}"> | ||
| {% if value.title %} | ||
| {{ value.title }} | ||
| {% else %} | ||
| {{ value.page.title }} | ||
| {% endif %} | ||
| </a> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| context: | ||
| value: | ||
| page: | ||
| title: Charity | ||
| url: '#' | ||
| title: Charity | ||
| style: charity | ||
|
|
||
| tags: | ||
| pageurl: | ||
| value.page: | ||
| raw: '#' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,29 @@ | ||
| {% load wagtailcore_tags %} | ||
|
|
||
| <div class="title-filters {% if hide_tags %}title-filters--no-tags{% endif %}"> | ||
| <div class="title-filters {% if introduction or page_links %}title-filters--no-tags{% endif %}"> | ||
| <div class="title-filters__title"> | ||
| <h1 class="heading heading--mega">{{ item.title }}</h1> | ||
| </div> | ||
|
|
||
| {% if tags and not hide_tags %} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note, we not longer need |
||
| {% if introduction or page_links %} | ||
| <div class="title-filters__info"> | ||
| {% if introduction %} | ||
| <div class="title-filters__introduction"> | ||
| <p>{{ introduction|linebreaksbr }}</p> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if page_links %} | ||
| <div class="title-filters__styled-page-links styled-page-links"> | ||
| {% for block in page_links %} | ||
| {% include_block block %} | ||
| {% endfor %} | ||
| </div> | ||
| {% endif %} | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| {% if tags and not introduction and not page_links %} | ||
| <div class="title-filters__tags"> | ||
| <div class="tags"> | ||
| <p class="sr-only">Filter by category</p> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,8 @@ | |
|
|
||
| {% block content %} | ||
| <div class="grid grid--spacer-large"> | ||
| {% include "patterns/molecules/title-filters/title-filters.html" with item=page tags=tags %} | ||
|
|
||
| {% include "patterns/molecules/title-filters/title-filters.html" with item=page tags=tags introduction=page.introduction page_links=page.page_links %} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as discussed, probably best to add the intro and page links below in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, yeah. Will have a look after my calls and make some suggestions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. <ul class="page-listing page-listing--blog">
<li class="listing page-listing__item rich-text">
<p>{{ page.introduction|linebreaksbr }}</p>
{% if page.page_links %}
<div class="styled-page-links">
{% for block in page.page_links %}
{% include_block block %}
{% endfor %}
</div>
{% endif %}
</li>
{% for post in blog_posts %}
...
should do the trick |
||
|
|
||
| <ul class="page-listing page-listing--blog"> | ||
| {% for post in blog_posts %} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| @use 'config' as *; | ||
|
|
||
| .styled-page-links { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: $spacer-mini; | ||
|
|
||
| &__button { | ||
| &--theme-coral { | ||
| &:focus, | ||
| &:hover { | ||
| background-color: var(--color--coral); | ||
| color: var(--color--white); | ||
| } | ||
| } | ||
|
|
||
| &--theme-nebuline { | ||
| &:focus, | ||
| &:hover { | ||
| background-color: var(--color--nebuline); | ||
| color: var(--color--white); | ||
| } | ||
| } | ||
|
|
||
| &--theme-lagoon { | ||
| &:focus, | ||
| &:hover { | ||
| background-color: var(--color--lagoon); | ||
| color: var(--color--white); | ||
| } | ||
| } | ||
| } | ||
| } |

Uh oh!
There was an error while loading. Please reload this page.