Configuring Live Copy

Internationalization

This page describes how to configure i18n for your live copy site.

In this example, we make a live copy of the Magnolia Travel demo. The master is in English and German. We want the live copy to be in German only.

  1. Create a live copy of your master site.

  2. Go to your master site definition in the Resource Files app.

  3. Create a copy of the master site definition.

    In this example, we create a live copy of the travel-demo site. Therefore, we create a copy of the travel-demo site definition yaml file, travel.yaml.

    Site definitions in the Ressources app

  4. Edit the live copy site definition as follows:

    travel-demo/sites/travel0.yaml
    domains:
      travel-demo:
        name: travel0-demo.magnolia-cms.com (1)
    mappings:
      website:
        URIPrefix: ''
        handlePrefix: /travel0 (1)
        repository: website
    templates:
      class: info.magnolia.module.site.templates.ReferencingPrototypeTemplateSettings
      prototypeId: travel-demo:pages/prototype
      availability:
        templates:
          home:
            id: travel-demo:pages/home
          standard:
            id: travel-demo:pages/standard
          searchResultPage:
            id: travel-demo:pages/searchResultPage
          pur:
            id: travel-demo:pages/pur
        enableAllWithRenderType:
          freemarker: freemarker
          spa: spa
    theme:
      name: travel-demo-theme
    i18n:
      class: info.magnolia.cms.i18n.IetfI18nContentSupport
      enabled: true
      fallbackLocale: de (2)
      locales: (3)
        de:
          enabled: true
          languageTag: de
    1 Update the domain and mappings to match the live copy name.
    2 Change the fallback locale to de (German).
    3 Delete the other locales and only leave de.

    When the author now opens a live copy page, the language switcher does not appear at the bottom of the page and the content presented is the German version.

About locales

Locales are display languages on Magnolia instances. When you create a live copy of your page, the new page (live copy) adopts the same structure as the original (master). This means that the locales of the master site definition are used to define the structure of both the master and live copy pages. The fallbackLocale defines which language is used by default from the available locales and which content is served if the content is not available for the current locale.

You can read the Language configuration page for information about defining available locales, and the Internationalization page for more information about translated user interface texts (see examples in the table below).

Master Live copy

title = Hello world

title = Hello world

title_de = Hallo Welt

title_de = Hallo Welt

Defining fallbackLocale does not affect the structure of the live copy or the master pages. For example, defining this property as de is like stating that the content of the live copy page will be rendered in the German locale by default when first loaded.

Create live copy action

You can configure the following for the Create live copy action:

  • Parallel or sequential creation

    Allow users to create multiple live copies in parallel, or block the action (and the push changes actions) to prevent new creations once a creation operation has started. By default, live copy creation is set to run sequentially for performance reasons.

  • Child node copying

    Allow users to create live copies of child nodes even when the parent node is already being copied. By default, users can’t create live copies of child nodes if the parent node is being copied.

/livecopy/decorations/pages-app/apps/pages-app.subApps.browser.actions.yaml
createLiveCopy:
  icon: icon-livecopy_new
  class: info.magnolia.livecopy.actions.BulkLiveCopyActionDefinition
  asynchronous: true
  availability:
    writePermissionRequired: true
    root: false
    rules:
      IsLiveCopyRunningRule:
        class: info.magnolia.livecopy.app.availability.IsLiveCopyRunningRuleDefinition
        parallel: false (1)
        recursive: true (2)

The info.magnolia.livecopy.app.availability.IsLiveCopyRunningRuleDefinition action has two properties:

1 parallel, set to false by default.

Once a create live copy action starts, you can’t perform any additional creation or push changes operations until it is complete. Set to true to allow multiple live copy creation actions to run in parallel. Note that this may affect performance if many copies are created simultaneously.

2 recursive, set to true by default.

When the create live copy action is triggered for a parent node, both the node and its children are locked, making the action unavailable until the parent node live copy creation completes. Set to false to allow live copies of child nodes to be created while the operation is still running for the parent node.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Live Copy module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules