From 4e0b47f38a6099df771ff897a1b1f7352163bf26 Mon Sep 17 00:00:00 2001 From: Shinsina Date: Thu, 11 Jul 2024 11:07:23 -0500 Subject: [PATCH 1/2] Allow explicit image sizing on Native-X promo cards --- .../components/blocks/native-x-promo-card.marko | 12 ++++++++++-- .../components/nodes/standard-promo.marko | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/marko-web-theme-monorail/components/blocks/native-x-promo-card.marko b/packages/marko-web-theme-monorail/components/blocks/native-x-promo-card.marko index 7bbfbfa5b..f31cba03c 100644 --- a/packages/marko-web-theme-monorail/components/blocks/native-x-promo-card.marko +++ b/packages/marko-web-theme-monorail/components/blocks/native-x-promo-card.marko @@ -15,12 +15,20 @@ $ const placement = nxConfig.getPlacement({ name: placementName, aliases }); - + - + diff --git a/packages/marko-web-theme-monorail/components/nodes/standard-promo.marko b/packages/marko-web-theme-monorail/components/nodes/standard-promo.marko index 2b50ee12e..831ba7b81 100644 --- a/packages/marko-web-theme-monorail/components/nodes/standard-promo.marko +++ b/packages/marko-web-theme-monorail/components/nodes/standard-promo.marko @@ -1,7 +1,7 @@ import { get } from "@parameter1/base-cms-object-path"; import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value"; -$ const { node } = input; +$ const { node, imageWidth, imageHeight } = input; $ const linkText = get(node, "linkText") || defaultValue(input.linkText, "Read More"); $ const blockName = defaultValue(input.blockName, "pib-page-card"); @@ -31,6 +31,7 @@ $ const blockName = defaultValue(input.blockName, "pib-page-card"); src=node.primaryImage.src srcset=[`${node.primaryImage.src}&dpr=2 2x`] alt=node.primaryImage.alt + attrs={ width: imageWidth, height: imageHeight } /> From bfa02c14356056a42a55d685f9c83b5aa051e31e Mon Sep 17 00:00:00 2001 From: Shinsina Date: Thu, 11 Jul 2024 11:07:37 -0500 Subject: [PATCH 2/2] Allow explicit image sizing on inline and pushdown signups --- .../browser/idx-newsletter-form/inline.vue | 16 +++++++++++++++- .../browser/idx-newsletter-form/pushdown.vue | 10 ++++++++++ .../identity-x/newsletter-pushdown.marko | 2 ++ .../utils/site-idx-newsletter-menu-props.js | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue b/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue index eeb6a1cec..8afe40a7e 100644 --- a/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue +++ b/packages/marko-web-theme-monorail/browser/idx-newsletter-form/inline.vue @@ -3,7 +3,13 @@
- +
@@ -95,6 +101,14 @@ export default { type: String, default: null, }, + imageWidth: { + type: String, + default: '', + }, + imageHeight: { + type: String, + default: '', + }, lang: { type: String, default: 'en', diff --git a/packages/marko-web-theme-monorail/browser/idx-newsletter-form/pushdown.vue b/packages/marko-web-theme-monorail/browser/idx-newsletter-form/pushdown.vue index 77e8673f5..677fe4776 100644 --- a/packages/marko-web-theme-monorail/browser/idx-newsletter-form/pushdown.vue +++ b/packages/marko-web-theme-monorail/browser/idx-newsletter-form/pushdown.vue @@ -9,6 +9,8 @@ :srcset="imageSrcset" :alt="name" :class="element('image')" + :width="imageWidth" + :height="imageHeight" >
@@ -91,6 +93,14 @@ export default { type: String, default: null, }, + imageWidth: { + type: String, + default: '', + }, + imageHeight: { + type: String, + default: '', + }, initiallyExpanded: { type: Boolean, default: false, diff --git a/packages/marko-web-theme-monorail/components/identity-x/newsletter-pushdown.marko b/packages/marko-web-theme-monorail/components/identity-x/newsletter-pushdown.marko index 7feee0428..3eceee77b 100644 --- a/packages/marko-web-theme-monorail/components/identity-x/newsletter-pushdown.marko +++ b/packages/marko-web-theme-monorail/components/identity-x/newsletter-pushdown.marko @@ -38,6 +38,8 @@ $ const imageSrcset = imageSrc ? `${imageSrc}&dpr=2 2x` : null; disabled, imageSrc, imageSrcset, + imageWidth: input.imageWidth, + imageHeight: input.imageHeight, initiallyExpanded, lang, additionalEventData, diff --git a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js index 291437c83..593a92f5a 100644 --- a/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js +++ b/packages/marko-web-theme-monorail/utils/site-idx-newsletter-menu-props.js @@ -33,6 +33,8 @@ module.exports = ({ out, input }) => { return { ...((withImage && imageSrc) && { imageSrc }), ...((withImage && imageSrcset) && { imageSrcset }), + imageWidth: defaultValue(input.imageWidth, ''), + imageHeight: defaultValue(input.imageHeight, ''), siteName: config.website('name'), name, description,