ElementorexCms.Components (ElementorexCms v0.2.0)

Copy Markdown View Source

Components to show documents on your site.

import ElementorexCms.Components

<.document document={@page.body} />

The document is normalized (see ElementorexCms.Document.normalize/2) and rendered with its stylesheet. Blocks use daisyUI 5 and Tailwind classes, so your Tailwind build has to scan the library (see the README).

Summary

Functions

Renders a document.

Functions

document(assigns)

Renders a document.

Attributes

  • document - the document map (nil renders nothing)
  • registry - blocks to use (default ElementorexCms.Registry.default/0)
  • data - extra data for blocks that need it (@ctx.data in the block)
  • class - classes for the root element
  • locale - language of the texts the blocks add themselves (countdown units, placeholders…); default: the locale of the process (see ElementorexCms.I18n)
  • record - the record a template shows (a product on its page): props bound to fields take its values (see ElementorexCms.Dynamic)
  • source - the source of record (its key, like "products"); found from the record's Ecto schema when not given
  • sources - the sources of dynamic content (default ElementorexCms.Sources.default/0)
  • params - the query params of the page: loops read their page and the visitors' filters from them (params={@params} from mount/3, or @conn.params)

A template for the pages of a source:

<ElementorexCms.Components.document document={@template.body} record={@product} />

Attributes

  • document (:map) - Defaults to nil.
  • registry (:any) - Defaults to nil.
  • data (:map) - Defaults to %{}.
  • mode (:atom) - Defaults to :public. Must be one of :public, or :editor.
  • class (:any) - Defaults to nil.
  • locale (:string) - Defaults to nil.
  • record (:any) - Defaults to nil.
  • source (:any) - Defaults to nil.
  • sources (:any) - Defaults to nil.
  • params (:map) - Defaults to %{}.