Skip to main content
Documentation/Elements & Controls Reference/Elements/Advanced/Code Block

Code Block

Code Block adds PHP and HTML output, CSS, or JavaScript within a document. Use it for a specific custom behavior or markup that the ordinary elements do not provide.

Add and configure Code Block

  1. Click Add, choose Code Block, and place it in the container.
  2. Enter markup or PHP under Content > Content > PHP & HTML Code, or use the separate CSS Code and JavaScript Code fields.
  3. Review Execute JavaScript and the optional Builder Label settings.
  4. Configure the wrapper's layout, typography, and spacing under Design.
  5. Save your changes.
Code Block controls in the Breakdance editor
Code Block controls in the Breakdance editor

This element has no children; use its own controls.

Controls

Responsive varies by breakpoint; Hover has a hover value; Shared applies across both. Linked controls have their own reference. In conditions, = means “is” and ≠ means “is not.”

Content > Content

Setting Purpose and options Behavior
PHP & HTML Code Enter the php & html code code. Shared
CSS Code Enter the css code code. Shared
JavaScript Code Enter the JavaScript code. Shared
Execute JavaScript Run the code in the builder preview. Shared
Disable Builder Label On/off. Shared
Builder Label Enter the builder label. When: Disable Builder Label is unset. Shared

Design > Wrapper

Setting Purpose and options Behavior
Width Width. Responsive
Background Color or supported fill. Shared
Borders borders controls. See linked controls
Padding spacing controls. See linked controls

Design > Layout

Setting Purpose and options Behavior
Layout layout controls. When: Layout is set. See linked controls

Design > Layout

Setting Purpose and options Behavior
Layout layout controls. When: Layout is unset. See linked controls

Design > Typography

Setting Purpose and options Behavior
Typography typography controls. See linked controls

Design > Spacing

Setting Purpose and options Behavior
Spacing spacing controls. See linked controls

Troubleshooting

The editor shows a label instead of the expected appearance

Review Builder Label and Disable Builder Label. The label identifies the code block while editing; inspect the actual front-end output.

The code causes an error

Check each language in its corresponding field and isolate the smallest failing change. PHP output, CSS styling, and browser JavaScript run in different contexts.