Skip to main content

Code Embed Slice: Supported Use Cases

B
Written by Beth Graff

Overview

The Code Embed slice lets you insert raw HTML directly into a page on your Treez eCommerce site. It renders content using dangerouslySetInnerHTML, meaning whatever HTML you place in the field is injected as-is into the page.

Think of it as an HTML and iframe embed slot — great for static markup and self-contained embeds, but not designed to run external JavaScript widgets.

What the Code Embed slice supports

  • Static HTML & CSS — Custom layouts, styled divs, tables, and any HTML structure that does not rely on JavaScript. Renders reliably.

  • iframes — Embed Google Maps, Typeform, Calendly, YouTube, Vimeo, or any service that provides an <iframe> embed code. iframes run in their own context and do not depend on the page's JavaScript.

  • Inline styles — Custom <style> blocks to adjust or override section styling for a specific page.

  • Non-JS widgets delivered as iframes — If a third-party tool gives you an <iframe src="..."> embed, it will work correctly.

What the Code Embed slice does not support

  • External script + init call widgets — Widgets that require loading an external .js file and then calling an initialization function (e.g. jobs boards, chat widgets, review carousels). The script tags are present in the HTML but are not re-executed after the page loads, so the widget will not render.

  • Inline <script> blocks with JavaScript logic — For the same reason, any inline script that needs to run code will not execute as expected.

When to use an iframe instead

If a third-party service offers both an iframe embed and a script-based widget, always use the iframe version in the Code Embed slice. Examples:

  • Google Maps → use the iframe embed from the Google Maps share menu

  • Typeform → use the standard iframe embed, not the widget script

  • Calendly → use <iframe src="https://calendly.com/...">, not the Calendly widget.js approach

Did this answer your question?