{% endmacro %}
\ No newline at end of file
diff --git a/src/wmcads/components/page-contents/_page-contents.scss b/src/wmcads/components/page-contents/_page-contents.scss
index d5894985..819857df 100644
--- a/src/wmcads/components/page-contents/_page-contents.scss
+++ b/src/wmcads/components/page-contents/_page-contents.scss
@@ -1,4 +1,6 @@
.wmcads-page-contents {
+ position: sticky;
+ top: 0;
margin-bottom: 30px;
padding: 10px;
border-bottom: 3px solid $black;
@@ -22,8 +24,7 @@
a {
display: block;
margin-bottom: 10px;
- overflow: hidden;
text-overflow: ellipsis;
- white-space: nowrap;
+ white-space: wrap;
}
}
diff --git a/src/www/pages/components/page-contents/index.njk b/src/www/pages/components/page-contents/index.njk
index e6a5dcf8..e0734c15 100644
--- a/src/www/pages/components/page-contents/index.njk
+++ b/src/www/pages/components/page-contents/index.njk
@@ -6,7 +6,9 @@
{% block content %}
{{
compExample([
- wmcadsPageContents()
+ wmcadsPageContents({
+ example: true
+ })
])
}}
{% endblock %}
\ No newline at end of file
diff --git a/src/www/pages/templates/campaign-one-column/index.njk b/src/www/pages/templates/campaign-one-column/index.njk
index 488d160e..f48fc4bc 100644
--- a/src/www/pages/templates/campaign-one-column/index.njk
+++ b/src/www/pages/templates/campaign-one-column/index.njk
@@ -49,6 +49,7 @@
src: true,
isThirdCard: false,
title: 'Get Going Continue Rolling',
+ isDefault: true,
copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.'
})
}}
@@ -60,35 +61,38 @@
src: true,
isThirdCard: false,
title: 'All things strolling',
+ isDefault: true,
copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. '
})
}}
-
+
{{
wmcadsContentCard({
clickable: true,
src: true,
isThirdCard: false,
title: 'Changes in your area',
+ isDefault: true,
copy: 'Understand what changes are being made in your area to help you travel safely'
})
}}
-
+
{{
wmcadsContentCard({
clickable: true,
src: true,
isThirdCard: false,
title: 'Get active and travel safely',
+ isDefault: true,
copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. '
})
}}
-
+
Get the best from your bike
-
+
Additional Information
@@ -155,6 +159,7 @@
src: true,
isThirdCard: false,
title: 'Support for businesses',
+ isDefault: true,
copy: 'We have a wide range of options to support your business and employees at work and at home'
})
}}
@@ -166,13 +171,14 @@
src: true,
isThirdCard: false,
title: 'Be Aware and Share',
+ isDefault: true,
copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.'
})
}}
-
+
Campaign Funding Partners
diff --git a/src/www/pages/templates/campaign-two-columns/campaign-template.js b/src/www/pages/templates/campaign-two-columns/campaign-template.js
new file mode 100644
index 00000000..a7c15543
--- /dev/null
+++ b/src/www/pages/templates/campaign-two-columns/campaign-template.js
@@ -0,0 +1,33 @@
+const pageContents = () => {
+ const headings = document.querySelectorAll('.main h2');
+
+ headings.forEach(heading => {
+ const str = heading.innerHTML;
+ const linkStr = str.toLowerCase().replaceAll(' ', '-');
+ const link = `#${linkStr}`;
+
+ // add id to all the h2
+ heading.setAttribute('id', linkStr);
+
+ // function to decode htmlentities
+ function decodeHtml(html) {
+ const txt = document.createElement('textarea');
+ txt.innerHTML = html;
+ return txt.value;
+ }
+ // function to add a link to the page contents
+ function createMenuItem() {
+ const li = document.createElement('a');
+ li.textContent = decodeHtml(str);
+ li.setAttribute('href', link);
+ return li;
+ }
+
+ // get the page contents
+ const menu = document.querySelector('.wmcads-page-contents');
+ // add page contents link
+ menu.appendChild(createMenuItem());
+ });
+};
+
+export default pageContents;
diff --git a/src/www/pages/templates/campaign-two-columns/index.njk b/src/www/pages/templates/campaign-two-columns/index.njk
index e09b4f5d..7d864dd6 100644
--- a/src/www/pages/templates/campaign-two-columns/index.njk
+++ b/src/www/pages/templates/campaign-two-columns/index.njk
@@ -30,9 +30,13 @@
{{
wmcadsPageContents({
title: "Roll & Stroll",
- rightMargin: true
+ rightMargin: true,
+ example: false
})
}}
+
+
+
@@ -59,6 +63,7 @@
src: true,
isThirdCard: false,
title: 'Get Going Continue Rolling',
+ isDefault: true,
copy: 'Whether youre rolling to work or school, or catching some fresh air, theres always safe and new ways to get there.'
})
}}
@@ -70,35 +75,38 @@
src: true,
isThirdCard: false,
title: 'All things strolling',
+ isDefault: true,
copy: 'Wherever youre heading, theres always new and safe ways to get there on foot. '
})
}}
-
+
{{
wmcadsContentCard({
clickable: true,
src: true,
isThirdCard: false,
title: 'Changes in your area',
+ isDefault: true,
copy: 'Understand what changes are being made in your area to help you travel safely'
})
}}
-
+
{{
wmcadsContentCard({
clickable: true,
src: true,
isThirdCard: false,
title: 'Get active and travel safely',
+ isDefault: true,
copy: 'Enjoy being physically active and travelling outdoors responsibly and safely. '
})
}}
-
+
Get the best from your bike
-
+
Additional Information
@@ -165,6 +173,7 @@
src: true,
isThirdCard: false,
title: 'Support for businesses',
+ isDefault: true,
copy: 'We have a wide range of options to support your business and employees at work and at home'
})
}}
@@ -176,13 +185,14 @@
src: true,
isThirdCard: false,
title: 'Be Aware and Share',
+ isDefault: true,
copy: 'If you drive in the West Midlands be prepared to share the road space with more Rollers and Strollers.'
})
}}