Handle components without HTML wrappers

Created on 9 April 2025, about 1 month ago

Overview

When a component is placed it is assumed that it contains at least some HTML, which is wrapped in comments and has a data attribute attached so the XB UI can manipulate it.

However, it is not mandatory for components to output any HTML at all, e.g. if the component contains defensive code such as

{% if image and image.src %}
  <img src="{{ image.src }}" alt="{{ image.alt }}" />
{% endif %}

It is also possible for a component to output text, but not HTML.

Proposed resolution

When we are previewing a component that does not contain any HTML tags, detect this special situation and wrap them in a container, so they can still be previewed and manipulated correctly by the UI.

User interface changes

📌 Task
Status

Active

Version

0.0

Component

Page builder

Created by

🇬🇧United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024