Momentum for Craft CMS

Momentum is a Craft 6 plugin. Craft 6 is still in beta, and so is Momentum (6.0.0-beta.1) — try it on staging first and use caution on production sites.

Configuration

Settings → Momentum, or config/craft/momentum.php (lists may be arrays there).

SettingDefault
rootTemplate_momentum/rootTwig or Blade site template for first visits
viteEntriesnoneEntry points the default root template loads, one per line
propDepth2Relation hops serialised (0–5)
excludeFieldsnoneFields never sent, one rule per line
renameFieldsnonehandle: propName, one per line
assetTransformsnoneNamed image transforms added to image assets
shareCurrentUseroncurrentUser prop ({id, name}) on every page
assetVersionmanifest hashInertia asset version
deferFieldsnonePro. Fields sent as deferred props
ssroffPro. Server-side render first visits
ssrUrlinertia.ssr.urlPro. SSR server URL

Field rules

excludeFields, renameFields and deferFields take a field handle, optionally qualified by the entry type (or the volume, for assets):

internalNotes            # everywhere
article.seoNotes         # only on `article` entries
summary: excerpt                 # renamed everywhere
gallery.images: photos           # only on `gallery` entries

A qualified rule wins over a bare one. Rules are validated when you save: a handle with spaces or a rename that isn't handle: propName is refused.

Exclude anything private. Field visibility rules (conditions) are respected, but everything that remains is public JSON in the page source.

Example config file

// config/craft/momentum.php
return [
    'viteEntries' => ['resources/js/app.js'],
    'propDepth' => 1,
    'excludeFields' => ['internalNotes', 'article.seoNotes'],
    'renameFields' => ['summary: excerpt'],
    'assetTransforms' => ['thumb', 'hero'],
];

More plugins

Pairs well with Momentum