<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Email Image Module: Set Width on image placement in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/920248#M37814</link>
    <description>&lt;P&gt;The code for this is written in the fields.json file of the module which can only be accessed in a &lt;A href="https://developers.hubspot.com/docs/cms/guides/getting-started-with-local-development" target="_blank" rel="noopener"&gt;local development environment&lt;/A&gt;, not in the Design Manager. Likely cloning such module in the Design Manager causes those instructions to be overwritten since the Design Manager isn't aware of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You&amp;nbsp;&lt;EM&gt;can&amp;nbsp;&lt;/EM&gt;do something&amp;nbsp;&lt;EM&gt;similar&amp;nbsp;&lt;/EM&gt;in the Design Manager it just removes some options on the front-end.&lt;BR /&gt;&lt;BR /&gt;In the image field you would want to set &lt;STRONG&gt;Available size options&lt;/STRONG&gt;&amp;nbsp;to "Do not show controls". This will remove the width and height controls. You can leave them showing and the next step will still re-size the image, but the fields will not update with the re-sized values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="size-options.png" style="width: 326px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/109176i686EE2BE2063178B/image-size/large?v=v2&amp;amp;px=999" role="button" title="size-options.png" alt="size-options.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then edit the &lt;STRONG&gt;linked_image&lt;/STRONG&gt; tag to set &lt;CODE&gt;size_type&lt;/CODE&gt; to "auto_custom_max" and the &lt;CODE&gt;max_width&lt;/CODE&gt; to whatever you want the max width of the image to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% linked_image
    label="Linked Image",
    src='{{ module.img.src }}',
    alt='{{ module.img.alt }}',
    width='{{ module.img.width }}',
    height='{{ module.img.height }}',
    link='{{ link }}',
    target='{{ target }}',
    open_in_new_tab='{{ target }}',
    size_type='auto_custom_max',
    max_width='520',
    loading='{{ loadingAttr }}'
%}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 17:12:22 GMT</pubDate>
    <dc:creator>alyssamwilie</dc:creator>
    <dc:date>2024-02-09T17:12:22Z</dc:date>
    <item>
      <title>Email Image Module: Set Width on image placement</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/919457#M37788</link>
      <description>&lt;P&gt;The out-of-the-box Email Image Module, when selecting an image, automatically sets the width attribute for the image to the maximum width available within a column, factoring in padding etc.&lt;BR /&gt;&lt;BR /&gt;We needed to create our own version of the email image module.&amp;nbsp; I started with a clone of the OOTB module.&amp;nbsp; However, when an image is selected, the width attribute is set to the original image assets width.&amp;nbsp; Proper outlook display, and serving of appropriately sized images from the CDN (i believe) rely on this width attribute being appropriate to the available space.&amp;nbsp; I can trigger the width to adjust appropriately if I hit the down arrow on the width attribute, it forces HubSpot to correct this value the same way it does when an image is initially selected in the OOTB module.&lt;BR /&gt;&lt;BR /&gt;This extra step, although "simple" is an ongoing issue for our email editors to remember to do each and every time they swap out an image.&amp;nbsp; Is it possible to have this width attribute calculate correctly every time an image is selected without any other user interaction?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image-module-bug.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/109077i6A88EFA60FCE2B26/image-size/large?v=v2&amp;amp;px=999" role="button" title="image-module-bug.png" alt="image-module-bug.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 15:31:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/919457#M37788</guid>
      <dc:creator>robbn</dc:creator>
      <dc:date>2024-02-08T15:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Email Image Module: Set Width on image placement</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/920248#M37814</link>
      <description>&lt;P&gt;The code for this is written in the fields.json file of the module which can only be accessed in a &lt;A href="https://developers.hubspot.com/docs/cms/guides/getting-started-with-local-development" target="_blank" rel="noopener"&gt;local development environment&lt;/A&gt;, not in the Design Manager. Likely cloning such module in the Design Manager causes those instructions to be overwritten since the Design Manager isn't aware of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You&amp;nbsp;&lt;EM&gt;can&amp;nbsp;&lt;/EM&gt;do something&amp;nbsp;&lt;EM&gt;similar&amp;nbsp;&lt;/EM&gt;in the Design Manager it just removes some options on the front-end.&lt;BR /&gt;&lt;BR /&gt;In the image field you would want to set &lt;STRONG&gt;Available size options&lt;/STRONG&gt;&amp;nbsp;to "Do not show controls". This will remove the width and height controls. You can leave them showing and the next step will still re-size the image, but the fields will not update with the re-sized values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="size-options.png" style="width: 326px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/109176i686EE2BE2063178B/image-size/large?v=v2&amp;amp;px=999" role="button" title="size-options.png" alt="size-options.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then edit the &lt;STRONG&gt;linked_image&lt;/STRONG&gt; tag to set &lt;CODE&gt;size_type&lt;/CODE&gt; to "auto_custom_max" and the &lt;CODE&gt;max_width&lt;/CODE&gt; to whatever you want the max width of the image to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% linked_image
    label="Linked Image",
    src='{{ module.img.src }}',
    alt='{{ module.img.alt }}',
    width='{{ module.img.width }}',
    height='{{ module.img.height }}',
    link='{{ link }}',
    target='{{ target }}',
    open_in_new_tab='{{ target }}',
    size_type='auto_custom_max',
    max_width='520',
    loading='{{ loadingAttr }}'
%}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 17:12:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/920248#M37814</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2024-02-09T17:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Email Image Module: Set Width on image placement</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/920377#M37820</link>
      <description>&lt;P&gt;Thank you for the response.&lt;BR /&gt;&lt;BR /&gt;Unfortunately, and oddly enough -- we cannot get to the "image_email" module within the Design Manager (without a direct link provided by HubSpot support) nor can we fetch a local copy of it to investigate and potentially modify the fields.json file on our copy to function similarly.&lt;BR /&gt;&lt;BR /&gt;The alternative solution you provided doesn't seem to write in any width attribute, which is important for email images.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 21:26:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Email-Image-Module-Set-Width-on-image-placement/m-p/920377#M37820</guid>
      <dc:creator>robbn</dc:creator>
      <dc:date>2024-02-09T21:26:47Z</dc:date>
    </item>
  </channel>
</rss>

