From 28a853398a27b4c1fbcb927c9812640f9970fdc4 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 18 Feb 2024 20:20:42 +0000 Subject: [PATCH] Allow for setting a specific CTA from a library --- app/config/sculpin_site.yml | 4 ++++ source/_daily_emails/2024-02-18.md | 1 + source/_layouts/daily_email.html.twig | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml index 998b6526..c96fe091 100644 --- a/app/config/sculpin_site.yml +++ b/app/config/sculpin_site.yml @@ -8,6 +8,10 @@ banner_text: | In less than 12 months, Drupal 7 will be end-of-life and no longer supported. Plan your upgrade to Drupal 10 now. +ctas: + d7eol: | + There's less than a year until Drupal 7's end-of-life date. Plan your upgrade to Drupal 10 now! + imports: - ../../data/assets.yml - ../../data/meta.yml diff --git a/source/_daily_emails/2024-02-18.md b/source/_daily_emails/2024-02-18.md index c84c205a..fe07f0bd 100644 --- a/source/_daily_emails/2024-02-18.md +++ b/source/_daily_emails/2024-02-18.md @@ -10,6 +10,7 @@ tags: - front-end - software-development - css +cta: d7eol --- This week on the Beyond Blocks podcast, I'm joined by Mark Conroy - Director of Development at Annertech to discuss all things front-end development and building something useful in one day. diff --git a/source/_layouts/daily_email.html.twig b/source/_layouts/daily_email.html.twig index 04afd758..3cf6479c 100644 --- a/source/_layouts/daily_email.html.twig +++ b/source/_layouts/daily_email.html.twig @@ -6,7 +6,11 @@ {{ parent() }}

- Oliver

+ {% block cta %} + {% if page.cta and site.ctas[page.cta] is defined %} +

P.S. {{ site.ctas[page.cta]|raw }}

+ {% else %} {% set ctas = [ 'Are you still using Drupal 7 and don’t know what’s involved to upgrade to Drupal 10? Book a Drupal 7 upgrade consultation call or an upgrade roadmap.', 'Need help or want another pair of eyes on your code? Book a 1-on-1 consulting call or an online pair programming session with a 100% money-back guarantee.', @@ -14,6 +18,7 @@ ] %}

P.S. {{ random(ctas)|raw }}

+ {% endif %} {% endblock %} {% endblock %}