Helpers imported into every block (use ElementorexCms.Block).
The important one is root/2: spread it on the root element of the block.
<a href={@url} {root(assigns, class: ["btn", @wide && "btn-block"])}>...</a>
Summary
Functions
Renders the children of a container. On the canvas, an empty container shows a drop zone.
Joins classes, skipping nil, false and empty strings.
Whether the block is being rendered on the editor canvas.
An icon from Heroicons, inline SVG (works with any icon name chosen in the
editor, see ElementorexCms.Heroicons).
Marks the element that holds an inline-editable prop: on the canvas the user double-clicks it to type. Outside the editor it adds nothing.
href, target and rel for a link. An empty URL gives no href (on the
canvas links never navigate anyway).
Sanitized rich text (:rich policy) as safe HTML.
Sanitized inline HTML (:inline policy) as safe HTML.
Attributes for the root element of a block.
Inline style from validated declarations: [{"max-width", "640px"}] →
"max-width:640px". Invalid values are dropped (see ElementorexCms.CSS).
Translates a string of the block (see ElementorexCms.I18n).
Functions
Renders the children of a container. On the canvas, an empty container shows a drop zone.
Attributes
node(:map) (required)ctx(:any) (required)placeholder(:string) - Defaults tonil.
Joins classes, skipping nil, false and empty strings.
Whether the block is being rendered on the editor canvas.
An icon from Heroicons, inline SVG (works with any icon name chosen in the
editor, see ElementorexCms.Heroicons).
Attributes
name(:string) (required)style(:string) - Defaults to"outline".class(:any) - Defaults tonil.- Global attributes are accepted.
Marks the element that holds an inline-editable prop: on the canvas the user double-clicks it to type. Outside the editor it adds nothing.
<h2 {inline(assigns, :text)}>{@text}</h2>
href, target and rel for a link. An empty URL gives no href (on the
canvas links never navigate anyway).
@spec rich(String.t() | nil) :: Phoenix.HTML.safe()
Sanitized rich text (:rich policy) as safe HTML.
@spec rich_inline(String.t() | nil) :: Phoenix.HTML.safe()
Sanitized inline HTML (:inline policy) as safe HTML.
Attributes for the root element of a block.
data-ex-id- the node id; the node's CSS is scoped to itidandclassfrom the Advanced tab, merged with:class- on the canvas,
data-ex-typeanddata-ex-containerfor the editor
Options:
:class- classes of the block (string, list,nil/falseare skipped):style- inline style string, written as is (build it from validated values only):attrs- extra attributes ([{"role", "alert"}])
Inline style from validated declarations: [{"max-width", "640px"}] →
"max-width:640px". Invalid values are dropped (see ElementorexCms.CSS).
Translates a string of the block (see ElementorexCms.I18n).