MishkaCmsCoreWeb.Templates.SeoForm (Mishka CMS Core v0.0.1)

Copy Markdown View Source

A MishkaGervaz custom form template, and the events its markup sends: the SEO tab of the builder's settings modal, over MishkaCmsCore.Runtime.PageBuilder.SeoSettings.

A page's tab is two columns: on the left its basics, its structured data, the variables those may use and an Advanced section (the canonical address, every tag, the JSON-LD); on the right its previews — Google, X, Facebook — drawn with placeholders or with one of the records of the kind the page shows each address of, which its General tab picks. A layout's is its tags and the variables. Every field shows its default as its placeholder, and a blank one uses it. The chips at the foot put a variable where the caret last was in a field marked data-seo-vars — see the PbSeoFields hook, which also puts the share image a Media pick sends (pb-seo-set) into its field.

The draft lives on the form's component

The form opens on the record SeoSettings reads, which is the draft. Each edit is SeoSettings.change/3 and lands on the component as @seo; Save sends SeoSettings.params/1 through Gervaz's own save, and the editor closes the modal on {:form_saved, :update, record}.

Cancel and Media name no phx-target: closing the modal and opening the Media sheet are the editor's.

Summary

Functions

render_field(assigns)

Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_field/1.

render_group(assigns)

Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_group/1.

render_step_indicator(assigns)

Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_step_indicator/1.