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.

Multi-site

Momentum renders each site's own version of an entry:

  • entry is the entry on the current site — its title, slug, URL and translated field values.
  • Relations resolve on the current site, so related entries carry that site's titles and URLs.
  • site is the current site (handle, name, language, baseUrl), for <html lang> or formatting.
  • Each site can use its own component: the inertia: template is a per-site section setting.

alternates

On multi-site installs, every page gets the entry's URL on each site it's live on:

"alternates": [
  { "site": "default", "language": "en-US", "url": "https://example.com/articles/hello", "current": false },
  { "site": "fr", "language": "fr-FR", "url": "https://example.com/fr/articles/bonjour", "current": true }
]

Use it for a language switcher or hreflang links. Sites where the entry is disabled are left out; with only one site left the list is empty. It costs one query.

<Head>
  <link v-for="alt in alternates" :key="alt.site" rel="alternate" :hreflang="alt.language" :href="alt.url" />
</Head>

Translations

Momentum's own strings (settings, messages) use the momentum translation category; copy lang/en/momentum.php to lang/<locale>/momentum.php to translate them. Your page content comes from Craft, already translated per site.

More plugins

Pairs well with Momentum