Skip to content

Commit 849dcfc

Browse files
authored
Make Ground Nav template more resilient (#991)
1 parent dc39b08 commit 849dcfc

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/gorgeous-lions-cross.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': patch
3+
---
4+
5+
Reduced errors when Ground Nav has incomplete data

src/components/ground-nav/ground-nav.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{% endset %}
1212

1313
<footer class="c-ground-nav">
14-
{% with action %}
14+
{% with action|default({}) %}
1515
<div class="c-ground-nav__action o-container">
1616
<div class="o-container__content c-ground-nav__action-inner">
1717
<h2 class="c-ground-nav__action-lead-in">
@@ -48,12 +48,12 @@
4848
Contact info
4949
</h2>
5050
{# https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address #}
51-
{% with organization %}
51+
{% with organization|default({}) %}
5252
<address class="c-ground-nav__organization">
5353
<a href="{{url}}" class="c-ground-nav__organization-name">
5454
{{name}}
5555
</a><br>
56-
{% with address %}
56+
{% with address|default({}) %}
5757
{{streetAddress}}<br>
5858
{{addressLocality}}, {{addressRegion}} {{postalCode}} {{addressCountry}}<br>
5959
{% endwith %}
@@ -95,7 +95,7 @@
9595
{# https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html #}
9696
<ul class="c-ground-nav__menu-items o-list" role="list">
9797
{% for item in menu.items %}
98-
<li class="class="c-ground-nav__menu-item">
98+
<li class="c-ground-nav__menu-item">
9999
<a class="c-ground-nav__menu-action"
100100
href="{{item.link}}"
101101
{% if item.current %}

0 commit comments

Comments
 (0)