CMS Development

Chappers
Participant

Embed code or create code block to display external content on a Hubspot web page

SOLVE

I have some code that should display a widget form. When I try to embed it or create a module to test this form displaying, it doesn't show anything when previewing the Hubspot CMS page I've added the code to. I'm wondering if I have to do something else e.g. like this info here about require.js > https://developers.hubspot.com/blog/use-web-components-in-hubspot-cms-development

 

The code I am trying to test is:

 

<div id="homewise-calculator"></div>
<script>
window.renderHomewiseCalculator({
targetSelector: '#homewise-calculator',
type: ' budget-booster-listing',
});
</script>

 

It also uses a URL reference which i understood should be in header:

 

<script src="https://homewise.dabdev.net/js/homewise-calculator-widget.js"></script>

0 Upvotes
1 Accepted solution
Chappers
Solution
Participant

Embed code or create code block to display external content on a Hubspot web page

SOLVE

Solved this with supplier dev. Turns out an additional space had crept into the code before the 'b' in budget-booster-listing 😱 🤣

View solution in original post

0 Upvotes
3 Replies 3
Chappers
Participant

Embed code or create code block to display external content on a Hubspot web page

SOLVE

Thanks @TomM2 - This coming week we're speaking with the company that supplied that code (the firm is non-Hubspot). Hopefully I can orientate them in the HS CMS. I've got some pointers to give them and the knowledge base info you flagged. Let's see how we get on ...

0 Upvotes
Chappers
Solution
Participant

Embed code or create code block to display external content on a Hubspot web page

SOLVE

Solved this with supplier dev. Turns out an additional space had crept into the code before the 'b' in budget-booster-listing 😱 🤣

0 Upvotes
TomM2
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

Embed code or create code block to display external content on a Hubspot web page

SOLVE

Hey @Chappers if you're just trying to add some custom code onto your site you could just use the "source code" button within a rich text module. 
Alternatively if you plan on reusing it, it might be beneficial to just create a custom module within the design manager and copy your code in here: https://knowledge.hubspot.com/design-manager/create-and-edit-modules

I just tested this out however and it looks like there's actually an issue with the code itself that's causing it not to appear on the page:

TomM2_0-1685541960390.png

 

Tom Mahon
Technical Consultant | Solutions Engineer | Community Champion
Baskey Digitial

Book a consultation

Did my post help answer your query? Help the community (and me) by marking it as a solution.