CMS Development

KasieMarie
Participant

Problem adding module to html file

Résolue

Hello community, 

 

I'm working on updating our blog template to add social sharing buttons. Because of our branding, I cannot use the hubspot developed module for social sharing and need to customize the icons. 

 

I put in the module snippet into the template code as seen below:

KasieMarie_0-1678900906713.png

The output that I get is:

KasieMarie_1-1678901033072.png

The problem is that I'm not seeing any of the social sharing buttons on the template where I put them (in live, or in preview).

KasieMarie_2-1678901258052.png

 

I do see the social sharing module in the blog editor. But, the issue is that I want to social sharing buttons as part of the blog template, not the blog post itself. 

*note: when I put in the snippet for the hubspot provided social sharing module, the code works fine.  

 

I've checked the path, I've manually entered the snippet, I've even re-cloned the social sharing module to ensure I didn't introduce a bug. 

 

Any help on this?

Best, 

Kasie

 

1 Solution acceptée
Anton
Solution
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

Problem adding module to html file

Résolue

Hi @KasieMarie

 

first thing I'd try would be to right click on the custom sharing module, copy the snippet and paste it into the template. 

 

Also try to change the name of this module in the template so it becomes something different. So instead of 

{% module "module_NUMBERS" path="" label="" %}

try

{% module "custom_social_sharing" path="" label="" %}

or change any number in the current name.

 

Technical background: You can't have the same name twice in a template.

 

best, 

Anton

 

Anton Bujanowski Signature

Voir la solution dans l'envoi d'origine

3 Réponses
co_space
Membre

Problem adding module to html file

Résolue

Did you ever find a solution? I'm dealing with a similar issue.

0 Votes
ankitparmar09
Contributeur de premier rang

Problem adding module to html file

Résolue

Problem adding module to html file

Hello @KasieMarie 

I can give you a module snipped, it can help you.

{% module "social_sharing" path="../modules/social-sharing", label="social-sharing" %}

 Thanks

Anton
Solution
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

Problem adding module to html file

Résolue

Hi @KasieMarie

 

first thing I'd try would be to right click on the custom sharing module, copy the snippet and paste it into the template. 

 

Also try to change the name of this module in the template so it becomes something different. So instead of 

{% module "module_NUMBERS" path="" label="" %}

try

{% module "custom_social_sharing" path="" label="" %}

or change any number in the current name.

 

Technical background: You can't have the same name twice in a template.

 

best, 

Anton

 

Anton Bujanowski Signature