CMS Development

KasieMarie
Participant

Problem adding module to html file

SOLVE

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 Accepted solution
Anton
Solution
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Problem adding module to html file

SOLVE

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

View solution in original post

3 Replies 3
co_space
Member

Problem adding module to html file

SOLVE

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

0 Upvotes
ankitparmar09
Top Contributor

Problem adding module to html file

SOLVE

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
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Problem adding module to html file

SOLVE

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