Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Compass Forms — an EmDash CMS plugin

Forms for EmDash the way editors expect them: insert a Form block from the editor's slash menu, choose the fields, publish. Submissions are stored in the CMS, listed under Admin → Form Submissions, and optionally emailed to you.

What you get

  • compass.form Portable Text block — headline, description, configurable fields (text / email / phone / multi-line), button label, success message. Leave the fields empty for a sensible Name / Email / Message default.
  • Stored submissions with an admin list page (newest 50, per-form counts).
  • Email notification per submission — set the address under Plugins → Compass Forms → Settings (requires an email provider configured in EmDash).
  • Spam basics — honeypot field and a minimum-fill-time check, validated server-side.
  • Analytics contract — the form emits cfh:form_view, cfh:submit, cfh:success, and cfh:error DOM events and mirrors them to dataLayer (cfh_form_view …), with no field values ever included. Trigger GA4's generate_lead on cfh_success.
  • Hosted mode — give the block a Compass client key and it renders the forms.compass.st embed instead: Cloudflare Turnstile, origin gating, routing and deliverability handled by the hosted service. Same markup contract, so your styles don't change.

Install

npm install @ecropolis/emdash-plugin-compass-forms
// astro.config.mjsimportcompassFormsfrom"@ecropolis/emdash-plugin-compass-forms";exportdefaultdefineConfig({integrations: [emdash({// ...plugins: [compassForms()],}),],});

This is a native (trusted) plugin — it ships an Astro component for site-side rendering, which sandboxed marketplace plugins cannot do. Its block components merge into <PortableText> automatically; no theme changes required.

Styling

The form emits the Compass cfh- class contract (.cfh-form, .cfh-field, .cfh-label, .cfh-input, .cfh-textarea, .cfh-error, .cfh-status, .cfh-status-error, .cfh-submit, .cfh-success, .cfh-hp). Two rules are load-bearing:

.cfh-error:empty { display: none; }
.cfh-status:empty { display: none; }

Ecropolis themes (e.g. Mainstreet) ship token-mapped styles for the full contract.

Notes and limits (v1)

  • Required-field enforcement is client-side; the server sanitizes and caps everything (field count, lengths, email shape) but does not know each block's field spec. Treat stored submissions as untrusted input.
  • The notification email is best-effort: a failed send never loses the stored submission.
  • Deleting the plugin's data on uninstall follows EmDash's deleteData flag.

License

MIT © Ecropolis

About

Forms for EmDash CMS: an editor-composable form block with stored submissions, email notification, and spam basics — upgradeable to the hosted Compass forms service

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages