From 3be842b2754f7cc34c9302aca17e188cc44709f4 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Tue, 9 Jul 2024 17:05:34 +0100 Subject: [PATCH 1/6] Added Request a meeting button --- blocks/event-summary/event-summary.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/event-summary/event-summary.js b/blocks/event-summary/event-summary.js index 01784a0..b52882e 100644 --- a/blocks/event-summary/event-summary.js +++ b/blocks/event-summary/event-summary.js @@ -56,10 +56,11 @@ export default async function decorate(block) { registerButtonLink = a({ href: registerButton, title }, 'Register Today'); } const registerButtonContainer = p({ class: 'button-container find-out-more' }, strong(registerButtonLink)); + const talkButtonContainer = p({ class: 'button-container' }, strong(a({ href: '/about-us/contact-us', title }, 'Request a Meeting/Contact Us'))); // Append elements to block block.appendChild(imageContainer); - block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventDescription, registerButtonContainer))); + block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventDescription, registerButtonContainer, talkButtonContainer))); // Add event listener to the 'Register Today' button registerButtonLink.addEventListener('click', (event) => { From f72807be783a410175ca971c7d85e75072862190 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Tue, 9 Jul 2024 17:22:49 +0100 Subject: [PATCH 2/6] Updated content to use rich text --- blocks/event-summary/event-summary.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/event-summary/event-summary.js b/blocks/event-summary/event-summary.js index b52882e..e5c929c 100644 --- a/blocks/event-summary/event-summary.js +++ b/blocks/event-summary/event-summary.js @@ -27,6 +27,7 @@ export default async function decorate(block) { const type = getMetadata('type'); const region = getMetadata('region'); const address = getMetadata('address'); + const eventSummary = document.querySelector('.eventsummary.block'); const outerBlock = document.querySelector('.section'); outerBlock.classList.add('outer'); @@ -60,7 +61,7 @@ export default async function decorate(block) { // Append elements to block block.appendChild(imageContainer); - block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventDescription, registerButtonContainer, talkButtonContainer))); + block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventSummary, registerButtonContainer, talkButtonContainer))); // Add event listener to the 'Register Today' button registerButtonLink.addEventListener('click', (event) => { From 6db821408ff9255c7192efbfa0b5ae43daf5f5bf Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Tue, 9 Jul 2024 17:35:07 +0100 Subject: [PATCH 3/6] fixing lint issue --- blocks/event-summary/event-summary.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/event-summary/event-summary.js b/blocks/event-summary/event-summary.js index e5c929c..eff55e7 100644 --- a/blocks/event-summary/event-summary.js +++ b/blocks/event-summary/event-summary.js @@ -50,7 +50,6 @@ export default async function decorate(block) { (address !== region ? li({ class: 'item region' }, region) : ''), ); let registerButtonLink; - const eventDescription = p(description); if (type === 'Conference') { registerButtonLink = a({ href: registerButton, title }, 'Visit the Event Website'); } else { From 177143fda9edca34c6f0a2b2020a924c8fd7458b Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Tue, 9 Jul 2024 17:36:49 +0100 Subject: [PATCH 4/6] Fixing lint issue --- blocks/event-summary/event-summary.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/event-summary/event-summary.js b/blocks/event-summary/event-summary.js index eff55e7..c1a7163 100644 --- a/blocks/event-summary/event-summary.js +++ b/blocks/event-summary/event-summary.js @@ -21,7 +21,6 @@ export default async function decorate(block) { } else { date = `${formattedEndDate}`; } const image = getMetadata('og:image'); - const description = getMetadata('og:description'); const registerButton = getMetadata('register-button'); const title = getMetadata('og:title'); const type = getMetadata('type'); From 233876fdbe0ec5d2db1f5bafcaf289927ce98779 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Wed, 17 Jul 2024 16:24:28 +0100 Subject: [PATCH 5/6] Updating to check for options --- blocks/event-summary/event-summary.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blocks/event-summary/event-summary.js b/blocks/event-summary/event-summary.js index c1a7163..1c399e6 100644 --- a/blocks/event-summary/event-summary.js +++ b/blocks/event-summary/event-summary.js @@ -23,9 +23,11 @@ export default async function decorate(block) { const image = getMetadata('og:image'); const registerButton = getMetadata('register-button'); const title = getMetadata('og:title'); + const description = getMetadata('og:description'); const type = getMetadata('type'); const region = getMetadata('region'); const address = getMetadata('address'); + const eventTitle = document.querySelector('.eventtitle.block'); const eventSummary = document.querySelector('.eventsummary.block'); const outerBlock = document.querySelector('.section'); @@ -41,7 +43,7 @@ export default async function decorate(block) { { class: 'event-date' }, `${date} ${eventTime}`, ) : p({ class: 'event-date' }, date)); - const eventSubtitle = h1({ class: 'event-subtitle' }, title); + const eventSubtitle = h1({ class: 'event-subtitle' }, eventTitle.textContent ? eventTitle : title); const keywordList = ul( { class: 'keyword-list' }, li({ class: 'item type' }, type), @@ -59,7 +61,7 @@ export default async function decorate(block) { // Append elements to block block.appendChild(imageContainer); - block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventSummary, registerButtonContainer, talkButtonContainer))); + block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventSummary.textContent ? eventSummary : description, registerButtonContainer, talkButtonContainer))); // Add event listener to the 'Register Today' button registerButtonLink.addEventListener('click', (event) => { From b75e2e69e5c3f8ccf4d89089b92e6050969c30e7 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Wed, 17 Jul 2024 16:35:07 +0100 Subject: [PATCH 6/6] Corrected to check if item exists --- blocks/event-summary/event-summary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/event-summary/event-summary.js b/blocks/event-summary/event-summary.js index 1c399e6..38e01fa 100644 --- a/blocks/event-summary/event-summary.js +++ b/blocks/event-summary/event-summary.js @@ -43,7 +43,7 @@ export default async function decorate(block) { { class: 'event-date' }, `${date} ${eventTime}`, ) : p({ class: 'event-date' }, date)); - const eventSubtitle = h1({ class: 'event-subtitle' }, eventTitle.textContent ? eventTitle : title); + const eventSubtitle = h1({ class: 'event-subtitle' }, eventTitle || title); const keywordList = ul( { class: 'keyword-list' }, li({ class: 'item type' }, type), @@ -61,7 +61,7 @@ export default async function decorate(block) { // Append elements to block block.appendChild(imageContainer); - block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventSummary.textContent ? eventSummary : description, registerButtonContainer, talkButtonContainer))); + block.appendChild(div({ class: 'event-details' }, eventDate, eventSubtitle, div({ class: 'event-keywords' }, keywordList), div({ class: 'event-description' }, eventSummary || description, registerButtonContainer, talkButtonContainer))); // Add event listener to the 'Register Today' button registerButtonLink.addEventListener('click', (event) => {