From df77acec7acad3968d54bc40a38949621d7bff6a Mon Sep 17 00:00:00 2001 From: pgilmore-phi Date: Tue, 8 Oct 2024 16:18:15 -0400 Subject: [PATCH] Added condition to load paid blog header fragment based on paid blog template class --- blocks/header-paid/header-paid.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blocks/header-paid/header-paid.js b/blocks/header-paid/header-paid.js index 27eaa6c..9d1c6f1 100644 --- a/blocks/header-paid/header-paid.js +++ b/blocks/header-paid/header-paid.js @@ -27,10 +27,18 @@ function instrumentTrackingEvents(header) { } export default async function decorate(block) { + // default paid header let baseHeaderUrl = '/fragments/us/header-paid'; if (isCanada) { baseHeaderUrl = '/fragments/ca/header-paid'; } + // paid blog page header + if (document.body.className.includes('paid-blog-page')) { + baseHeaderUrl = '/fragments/us/header-paid-blog'; + if (isCanada) { + baseHeaderUrl = '/fragments/ca/header-paid-blog'; + } + } const headerPaidContent = await loadFragment(baseHeaderUrl);