CMS Development

dannyalva
Membre

Help with logo module snippet for email custom template

Résolue

Hi,

 

I'm creating a custom email module. I want to use the Logo module and I would like to modify the width in the parameters but I can't seem to figure it out

 

This is my attempt but doesn't work

 

{%

module "email_template_logo"

path="@hubspot/logo"

label="Logo"

image={

  "width" : 100

}

%}

 

I hope someone can enlighten me with this issue. I don't want to create a new logo module every time a template uses a different size.

 

Thanks

0 Votes
1 Solution acceptée
alyssamwilie
Solution
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Help with logo module snippet for email custom template

Résolue

Essentially the same, you just don't need the override_inherited_src for regular image modules.

 

{% module "image_email" path="@hubspot/image_email",
  img={
    "src": "yourimageurl.png",
    "width": 100,
    "height": 100,
    "alt": "alt text here"
  }
%}

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

Voir la solution dans l'envoi d'origine

4 Réponses
alyssamwilie
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Help with logo module snippet for email custom template

Résolue

You need to change image to img. However, this won't work unless you upload your own image. This module works by pulling in the logo (width, height, alt, and url included) from Settings > Pages > Branding and does not let you change those defaults unless you choose to override the inherited source using "override_inherited_src": true and add your own image.

 

{%
  module "email_template_logo"
  path="@hubspot/logo"
  label="Logo"
  img={
    "override_inherited_src": true,
    "src": "yourimageurl.svg",
    "width" : 100
  }
%}

 

To use the logo without overriding the source you would need to use CSS to change the width and height rather than the module settings.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
0 Votes
dannyalva
Membre

Help with logo module snippet for email custom template

Résolue

Thank you Ayssa!

 

That was just what I wanted. 

 

Would this work also for the Image for emails module? 

 

{% module "image_email" path="@hubspot/image_email" %}

 

I need to add a default src in the parameters.

 

Thanks again!

 

 

 

0 Votes
alyssamwilie
Solution
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Help with logo module snippet for email custom template

Résolue

Essentially the same, you just don't need the override_inherited_src for regular image modules.

 

{% module "image_email" path="@hubspot/image_email",
  img={
    "src": "yourimageurl.png",
    "width": 100,
    "height": 100,
    "alt": "alt text here"
  }
%}

 

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
dannyalva
Membre

Help with logo module snippet for email custom template

Résolue

Thank you so much!

0 Votes