Insert custom html into blocs

Dear Sir/Madam,

After I design the site, if I have a block of html want to insert into container, how can I do it and save this as part of the .bloc file?

Use a code widget, if you intend to use more than plain html, turn off canvas preview for it.

Thanks Norm, is it the way to place a php shortcode also ?

Hi folks,
it’s christmas time and I think Norm and his team deserves a break.
With all due respact.

1 Like

Yes, just ensure you set your page suffix (file type) to php on any pages that use the php snippet.

Also disable canvas preview for the code widget before you paste your code in.

The .bloc file format is basically just a package that stores your page structure, so any code you add via the “HTML Widget” or “Code Bric” gets embedded into the XML/JSON structure of that file. If you’re trying to insert it into a specific container, make sure the container’s padding doesn’t clip your custom elements. I’ve noticed that if the HTML block is too complex, the internal preview sometimes glitches, so it’s always better to check the actual export in a browser. It definitely stays part of the project file though.