• Aufgepasst:

    HubSpot-Erfahrungen teilen & Amazon-Gutscheine erhalten

    Mehr erfahren

CMS Development

SJaeger
Mitwirkender/Mitwirkende

disable image resize if height and width is given

lösung

Hello,

 

have someone see the possibility to disable the auto resize hubspot function if the image height and width attribute is given?

because i need only a 270px image. if i give the right width and height attribute hubspot make automaticly a srcset instead of src attribute. same on picture tags, where i dont want srcset on img tags.

 

 

Nothing is impossible
0 Upvotes
1 Akzeptierte Lösung
piersg
Lösung
Autorität

disable image resize if height and width is given

lösung

These both worked for me in preventing Hubspot from adding srcset and automatic resizing parameters:

 

<img src="{{ resize_image_url(item.image.src ~ '?noresize', 270, 0, 270) }}" {{sizeAttrs}}>
<img src="{{item.image.src}}?noresize" {{sizeAttrs}}>

 

 

For the record, I see you've written your img src as item.image.url but the parameter of the image tag in Hubspot you need is item.image.src

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
4 Antworten
piersg
Autorität

disable image resize if height and width is given

lösung

Hi @SJaeger (thanks @Jaycee_Lewis). Yes, this is possible. Just add ?noresize to the end of the image src e.g.

<img src="{{module.img.src}}?noresize" alt="{{module.img.alt}}" height="{{module.img.height}}" width="{{module.img.width}}">

 

SJaeger
Mitwirkender/Mitwirkende

disable image resize if height and width is given

lösung

hello and thanks but still not working

<img class="img-fluid w-100" src="{{ resize_image_url(item.image.url ~ '?noresize', 270, 0, 270) }}" alt="{{ item.name|escape }}" {{ sizeAttrs }} loading="lazy">
{% require_head %}
<link rel="preload" as="image" href="{{ resize_image_url(item.image.url, 270, 0, 270) }}">
{% end_require_head %}
Nothing is impossible
0 Upvotes
piersg
Lösung
Autorität

disable image resize if height and width is given

lösung

These both worked for me in preventing Hubspot from adding srcset and automatic resizing parameters:

 

<img src="{{ resize_image_url(item.image.src ~ '?noresize', 270, 0, 270) }}" {{sizeAttrs}}>
<img src="{{item.image.src}}?noresize" {{sizeAttrs}}>

 

 

For the record, I see you've written your img src as item.image.url but the parameter of the image tag in Hubspot you need is item.image.src

0 Upvotes
Jaycee_Lewis
Community-Manager/-in
Community-Manager/-in

disable image resize if height and width is given

lösung

Hey, @SJaeger 👋 Thanks for the great question! @Oezcan and @piersg do you have any experience here with what @SJaeger is trying to accomplish?

 

Thank you! – Jaycee





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes