Ready-made blocks the content editor offers beside its single components — whole
MishkaCmsCore.Runtime.ContentComponents markers, components inside components and slots filled
in, so an author places one and only changes the words.
THEY COME FROM THE COMPONENTS' OWN EXAMPLES — a component's examples, finished uses of it as a
page would hold them, which a kit ships with its components and a component an author adds in the
CMS may carry too. Each example of each component the palette lists is read with the page builder's
template parser (MishkaCmsCore.Runtime.PageBuilder.Tree) and written as a marker: a component
as a component marker, a slot as a slot marker, HTML as the HTML it is. An example that needs
more than a marker holds — an expression, a loop, a component the palette does not list, a slot
its component does not declare — is not offered. Only the attributes a component declares and a
marker can carry are kept; the rest of an example's attributes are left to their defaults.
A component that declares how it arrives when dropped — the furnishing the page builder places
(MishkaCmsCore.Builder.Furnishing) — is offered that way too, first among its blocks: the plain
one, an author's starting point, named after the component itself.
Nothing here names a kit or a component: a site offers exactly the blocks its components bring.
Events
runtime:content:editor_blocks— before the blocks are offered, with%{site_id: site_id, blocks: blocks}and%{current_user: user}as meta. Each block is%{id, title, component, category, tree},treeaMishkaCmsCore.Runtime.ContentComponents.tree/0andtitlenilfor the plain one, which is named after its component. A plugin answers the map with otherblocksto add its own or take some away; the editor offers only those whose components the palette lists.
Summary
Functions
The blocks the editor offers on site_id to actor, given the palette's entries: every example
of every entry that a marker can hold, as a plugin answering runtime:content:editor_blocks
leaves them, with its marker.
The blocks one palette entry's examples make, listed the palette by name: each example a marker
can hold, in the order the component lists them.
The plain block of one palette entry, listed the palette by name: the component as its
furnishing says it arrives, when it says so and a marker can hold it.
Types
Functions
@spec available( [MishkaCmsCore.Runtime.ContentComponents.entry()], String.t() | nil, map() | nil ) :: [ block() ]
The blocks the editor offers on site_id to actor, given the palette's entries: every example
of every entry that a marker can hold, as a plugin answering runtime:content:editor_blocks
leaves them, with its marker.
@spec examples(MishkaCmsCore.Runtime.ContentComponents.entry(), %{ required(String.t()) => MishkaCmsCore.Runtime.ContentComponents.entry() }) :: [map()]
The blocks one palette entry's examples make, listed the palette by name: each example a marker
can hold, in the order the component lists them.
@spec plain(MishkaCmsCore.Runtime.ContentComponents.entry(), %{ required(String.t()) => MishkaCmsCore.Runtime.ContentComponents.entry() }) :: [map()]
The plain block of one palette entry, listed the palette by name: the component as its
furnishing says it arrives, when it says so and a marker can hold it.