Utilize Collection fields in personalized code injections

With Dynamic Embeds, you can use your CMS Collection fields to dynamically update embedded code.

Through dynamic injections, you have the flexibility to employ your CMS Collection fields for real-time updates in injected code. This enables the creation of interactive social sharing buttons, e-commerce platforms, podcast and music platforms, event websites, and much more.

Key components of a dynamic injection

Each dynamic injection varies slightly, but they all necessitate the following:

  • The external embed script with distinct identifiers for the content you wish to dynamically present (such as a tweet, Shopify item, or Eventbrite event)
  • A Webflow CMS Collection containing a Plain Text field for inputting the unique identifier

Development of a dynamic injection

Let’s craft a click-to-tweet button. To set up the dynamic injection:

  1. Establish a Plain text field in your collection for the unique identifier, naming it “Tweet text”
  2. Copy the code provided below
  1. Insert an Embed element in a Collection list or on a Collection page
  2. Paste the code
  3. Choose the unique identifier “Tweet Text”
  4. Click Include Field
  5. Pick “Tweet Text”
A HTML embed code editor is open and filled out. The + Add field button on the right side of the editor is highlighted. The drop down text menu "Tweet Text" is also highlighted on the editor.
Refer to a comprehensive guide on developing a more tailored click-to-tweet button.

Explore these guides to learn how to utilize dynamic injections for:

Recognized constraint: Dynamic injections involving E-commerce fields will not auto-update based on the selected variant. For instance, if a visitor on your site chooses a product variant with a different price, this price change will not be reflected via the dynamic injection, and the customer will observe no pricing modification.

Ewan Mak
Latest posts by Ewan Mak (see all)