Sub topic 3
Working in Experience Builder
This chapter assumes you can build a basic Lightning web component (HTML template, JavaScript class, meta file) and have a Salesforce DX project connected to an org. It covers how Experience Builder loads your components, so you can tell what the page editor controls and what your code controls.
What Experience Builder is
Experience Builder is the visual editor for an Experience Cloud site. You open it from Setup (Digital Experiences, then All Sites, then Builder) or from the site's workspace. It edits the site's pages, theme, and navigation. It also publishes the result.
Builder has two modes of work:
- Editing: you drag components onto a page, set their properties, and save a draft.
- Previewing: you view the draft as a site visitor, including the guest user or an external user profile.
A change stays in the draft until you publish it. Visitors see only the last published version.
The main areas of the editor
| Area | What it does |
|---|---|
| Components panel | Lists standard components and your exposed custom components. |
| Canvas | Shows the current page. Click a component to select it. |
| Property editor | Shows the properties of the selected component. |
| Pages menu | Switches between pages and creates new ones. |
| Settings and Theme | Control site-wide security, languages, branding, and the theme layout. |
Your custom component appears in the Components panel only if its meta file sets isExposed to true and lists a Community target. The next chapter covers that. If the component is missing from the panel, check the meta file first.
How a page is assembled
A page is a layout made of regions. Each region holds components. The theme layout supplies the header and footer, and each page supplies the content region. Builder stores this structure as metadata, so it deploys like code.
A typical editing session
- Open Builder and select the page you want to change.
- Drag your component from the Components panel into a region.
- Select the component and fill in its properties in the property editor.
- Use the preview option to view the page as a guest or logged-in user.
- Save, then publish when the page is ready.
Properties you set in the editor are passed to your component's @api fields. A value typed in the editor replaces the default in the meta file.
Common problems
- The component is not in the panel. The component is not exposed, has no Community target, or has not been deployed to the org. Builder also caches the component list, so refresh the editor after a deployment.
- The page looks right in Builder but not on the live site. You saved but did not publish.
- The page works for you but not for visitors. Preview as the guest user. A component may call Apex or read data that the guest profile cannot access.
- A property change has no effect. Confirm that the
@apifield name matches the propertynamein the meta file exactly, including case.
Exercise
Exercise
You deployed a new component and it does not appear in the Components panel in Builder. Name two things to check.
Show answer
Check that the meta file sets isExposed to true and includes a lightningCommunity_Page or lightningCommunity_Default target. Also confirm the deployment succeeded and refresh Builder, since it can show a stale component list.
Exercise
You changed a page in Builder and saved it, but visitors still see the old page. What step did you skip, and how can you check what a visitor sees?
Show answer
You did not publish. Saving keeps a draft only. Preview the site as the guest or an external user, or open the live site URL, to see the published version.