Skip to content

Commit 7c476d9

Browse files
committed
made article cards an include/footer bootstrap 5 fix (left to start)
1 parent 2e572c7 commit 7c476d9

File tree

4 files changed

+20
-39
lines changed

4 files changed

+20
-39
lines changed

templates/_includes/_content-builder/_blocks/latestArticles.twig

+2-17
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,8 @@
88
</div>
99
{% endif %}
1010
<div class="row {{ block.header | length ? "pt-4 pb-5" : "py-5" }}">
11-
{% for item in craft.entries.section('latest').all() | slice(0,3) %}
12-
<div class="col-12 col-md-6 col-lg-4 mb-4 latest-article">
13-
<a href="{{ item.url }}" class="d-flex flex-column">
14-
{% if item.summaryImage.one %}
15-
<div class="img mb-4">
16-
<img src="{{ item.summaryImage.one.url({ width: 800, height: 600, format: 'webp' }) }}" alt="{{ item.title }}" class="w-100">
17-
</div>
18-
{% endif %}
19-
<h4 class="title pt-2 mb-3">
20-
<span>{{ item.title|length > 45 ? item.title|slice(0, 45) ~ '...' : item.title }}</span>
21-
</h4>
22-
{% if item.pageSummary %}
23-
<div class="copy mb-3">{{ item.pageSummary|length > 170 ? item.pageSummary|slice(0, 170) ~ '...' : item.pageSummary }}</div>
24-
{% endif %}
25-
<h6>{{ item.postDate | date("M d, Y") | upper }}</h6>
26-
</a>
27-
</div>
11+
{% for item in craft.entries.section('latest').limit(3).all() %}
12+
{% include '/_includes/_content-builder/_partial/article.twig' %}
2813
{% endfor %}
2914
</div>
3015
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<div class="col-12 col-md-6 col-lg-4 mb-4 article">
2+
<a href="{{ item.url }}" class="d-flex flex-column">
3+
{% if item.summaryImage.one %}
4+
<div class="img mb-4">
5+
<img src="{{ item.summaryImage.one.url({ width: 800, height: 600, format: 'webp' }) }}" alt="{{ item.title }}" class="w-100">
6+
</div>
7+
{% endif %}
8+
<h4 class="title pt-2 mb-3">
9+
<span>{{ item.title|length > 45 ? item.title|slice(0, 45) ~ '...' : item.title }}</span>
10+
</h4>
11+
{% if item.pageSummary %}
12+
<div class="copy mb-3">{{ item.pageSummary|length > 170 ? item.pageSummary|slice(0, 170) ~ '...' : item.pageSummary }}</div>
13+
{% endif %}
14+
<h6>{{ item.postDate | date("M d, Y") | upper }}</h6>
15+
</a>
16+
</div>

templates/_includes/_global/footer.twig

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{% set footerNav = craft.navigation.nodes().handle('footerNavigation').level(1).all() %}
2-
32
<footer>
4-
<div class="container text-center text-md-left">
3+
<div class="container text-center text-md-start">
54
<div class="row py-4">
65
<div class="col-12 col-md-3">
76
{% if companyInfo.address | length %}

templates/latest/index.twig

+1-20
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,7 @@
1313
{% set query = section.limit(6) %}
1414
{% paginate query as pageInfo, pageEntries %}
1515
{% for item in pageEntries %}
16-
<div class="col-12 col-md-6 col-lg-4 mb-4 latest-article d-flex flex-grow-1 flex-column">
17-
<a href="{{ item.url }}" class="d-flex flex-grow-1 flex-column">
18-
{% if item.summaryImage.one %}
19-
<div class="img mb-4">
20-
<img src="{{ item.summaryImage.one.url({width: 375, height: 220}) }}" alt="{{ item.title }}" class="w-100">
21-
</div>
22-
{% else %}
23-
<div class="img mb-4">
24-
<img src="https://via.placeholder.com/375x220?text=Missing+Summary+Image" alt="{{ item.title }}" class="w-100">
25-
</div>
26-
{% endif %}
27-
<h3 class="title pt-2 mb-3">
28-
<span>{{ item.title|length > 45 ? item.title|slice(0, 45) ~ '...' : item.title }}</span>
29-
</h3>
30-
{% if item.pageSummary %}
31-
<div class="copy mb-3">{{ item.pageSummary|length > 170 ? item.pageSummary|slice(0, 170) ~ '...' : item.pageSummary }}</div>
32-
{% endif %}
33-
<div>{{ item.postDate | date("M d, Y") | upper }}</div>
34-
</a>
35-
</div>
16+
{% include '/_includes/_content-builder/_partial/article.twig' %}
3617
{% endfor %}
3718
</div>
3819
{% if pageInfo.totalPages > 1 %}

0 commit comments

Comments
 (0)