Register now: Best Builder Practices for Marketers & Designers

Announcing Visual Copilot - Figma to production in half the time

Builder.io logo
Contact Sales
Platform
Developers
Contact Sales

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

You can use Builder Sections to create reusable content across multiple pages. You can manage the code within your codebase, and teammates in the UI can iterate in the Visual Editor.

Examples include:

This tutorial shows you how to create and add an announcement bar section to a page.

For more conceptual information Section Models, refer to the Section Models documentation.

To follow along with this tutorial, you should have the following:

  • a Builder account
  • an app in the framework of your choice with the appropriate Builder SDK installed

Create a Section model so you can make an announcement bar content entry.

  1. Go to Models.
  2. Click +Create Model.
  3. Select Section.
  4. Enter Announcement bar as the name for your new Section model.
  5. For all frameworks except Swift: change the Preview URL on the Model Options page to the URL of the page that you added code to display your section. This example uses http://localhost:####/announcements, but yours might be different.
  6. Click Save.

The video below demonstrates this process:

When you create or edit an announcement bar section, the Visual Editor displays your content embedded within your Preview URL page, providing visual context and importing styles from your site. It's a live view of your section, as it will look on one of your pages when you publish.

Published Sections typically appear across multiple pages with different URLs depending on how they're targeted. When previewing in the editor, however, they only appear within the Preview URL's page. For more information, refer to Editing and Previewing Your Site.

For more information what Section Models are and how to use them, refer to the Section Models documentation.

Now that your Section model is set up, you can create an announcement bar content entry to add an announcement bar to your site.

  1. Go to Content.
  2. Click the + New Entry button and select Announcement bar.
  3. Build and style your announcement bar.
  4. Name the content entry.
  5. Click Publish.

The video below demonstrates this process:

To make your announcement bar display based on targeting, in the section content entry; for example, in the announcement bar:

  1. Click on the Targeting icon.
  2. For Where, select URL path.
  3. Add the URL path you'd like to target.
  4. Click the Publish button.

The video below shows this process in an integrated Remix app where the targeted URL path is /builder so that the announcement bar doesn't show up on any other URLs. This process is the same, regardless of the framework you use. The URL path you target, however, might differ.

If you're using Gatsby, you might need to restart your app to render the announcement bar.

When working with sections that use custom fields or data models, it's helpful to set up live previewing. In this way you get real-time updates in the Visual Editor without having to publish your changes.

For detailed instructions on setting up live previewing for your custom fields and data models, visit Live Previewing Data Models and Custom Fields.

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Newsletter

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy

Product

Platform Overview

Integrations

What's New

Open Source

Builder

Builder

Mitosis

Mitosis

Qwik

Qwik

Partytown

Partytown

Popular Guides

From Design to Code Guide

Composable Commerce Guide

Headless CMS Guide

Headless Commerce Guide

Composable DXP Guide

Design to Code

Resources

Blog

Knowledge Base

Community Forum

Partners

Templates

Success Stories

Showcase

Resource Center

Frameworks

React

React

Next

Next.js

Qwik

Qwik

Gatsby

Gatsby

Angular

Angular

Vue

Vue

Svelte

Svelte

Remix logo

Remix

Nuxt

Nuxt

Hydrogen

Hydrogen

See All

© 2024 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms

Security & Compliance

Cookie Preferences