Use Case

This document assumes that you have already created a basic localized site structure for your project. It uses the following structure for the wknd brand with a presence in Switzerland and Germany as an example.

/content/wknd
/content/wknd/language-masters
/content/wknd/language-masters/en
/content/wknd/language-masters/de
/content/wknd/language-masters/fr
/content/wknd/language-masters/it
/content/wknd/ch
/content/wknd/ch/de
/content/wknd/ch/fr
/content/wknd/ch/it
/content/wknd/ch/en
/content/wknd/de
/content/wknd/de/de
/content/wknd/de/en

Content in language-masters is the source of Live Copies for the localized sites: Germany (de) and Switzerland (ch). The goal of this document is to create Edge Delivery Services sites that all use the same code base for each localized site.

Configuration

There are several steps to configuring the MSM repoless use case.

Update AEM Site Configurations

Configurations can be thought of as workspaces that can be used to gather groups of settings and their associated content for organizational purposes. When you create a site in AEM, a configuration is automatically created for it.

You generally want to share certain content between sites such as:

  • Templates created from content in the blueprint
  • Content Fragment models, persisted, queries etc.

You can create additional configurations to facilitate such sharing. For the wknd use case, we would need configurations for the following paths.

/content/wknd
/content/wknd/ch
/content/wknd/de

That is, you will have a configuration for the root of the wknd brand’s content (/content/wknd) used by the blueprints and a configuration used by each localized site (Switzerland and Germany).

  1. Sign into your AEM authoring instance.
  2. Navigate to the Configuration Browser by going to Tools -> General -> Configuration Browser.
  3. Select the configuration that was automatically created for your project (in this case wknd) and then tap or click Create in the toolbar.
  4. In the Create Configuration dialog, provide a descriptive Name for your localized site (such as Switzerland) and for the Title use the same title of the localized size (in this case ch).
  5. Select the Cloud Configuration feature and any additional features you may need for your project such as Editable Templates.
  6. Tap or click Create.

Create configurations for each localized site you need. In the case of wknd, you would need you create a configuration for de as well alongside the ch configuration.

Once the configurations are created, you need to ensure that the localized sites use them.

  1. Sign into your AEM authoring instance.
  2. Navigate to the Sites Console by going to Navigation -> Sites.
  3. Select the localized site such as Switzerland.
  4. Tap or click Properties in the tool bar.
  5. In the page properties window, select the Advanced tab and under the Configuration heading, unselect the option Inherited from /content/wknd, where wknd is the site root.
  6. In Cloud Configuration field, use the path browser to select the configuration you created for your localized site such as Switzerland under /conf/wknd/ch.
  7. Tap or click Save & Close.

Assign the respective configurations to the additional localized sites. In the case of wknd, you would need to assign the /conf/wknd/de configuration to the Germany site as well.

Create New Edge Delivery Services Sites for Your Localized Pages

To connect more sites to Edge Delivery Services for a multi-region, multi-language site setup, you must set up a new aem.live site for each of your AEM MSM sites. There is a 1:1 relationship between AEM MSM sites and aem.live sites with a shared Git repository and code base.

For this example, we will create the site wknd-ch for the Swiss presence of wknd, whose localized content is under the AEM path /content/wknd/ch.

  1. Retrieve your auth token and the technical account for your program.

  2. Create a new site by making the following call to the configuration service. Please consider:

    • The project name in the POST URL must be the new site name you are creating. In this example, it is wknd-ch.

    • The code configuration should be the same as you used for the initial project creation.

    • The content > source > url must be adapted to the name of the new site you are creating. In this example, it is wknd-ch.

    • I.e., the site name in POST URL and the content > source > url must be the same.

    • Adapt the admin block to define the users who should have full administrative access to the site.

    curl --request POST \
      --url https://admin.hlx.page/config/<your-github-org>/sites/wknd-ch.json \
      --header 'Content-Type: application/json' \
      --header 'x-auth-token: <your-token>' \
      --data '{
        "code": {
            "owner": "<your-github-org>",
            "repo": "wknd",
            "source": {
                "type": "github",
                "url": "https://github.com/<your-github-org>/wknd"
            }
        },
        "content": {
            "source": {
                "url": "https://author-p<programID>-e<environmentID>.adobeaemcloud.com/bin/franklin.delivery/<your-github-org>/wknd-ch/main",
                "type": "markup",
                "suffix": ".html"
            }
        },
        "access": {
            "admin": {
                "role": {
                    "admin": [
                        "<email>@<domain>.<tld>"
                    ],
                    "config_admin": [
                        "<tech-account-id>@techacct.adobe.com"
                    ]
                },
                "requireAuth": "auto"
            }
        }
    }'
    
  3. Add the path mapping for your new site by making the following call to the configuration service.

    curl --request POST \
      --url https://admin.hlx.page/config/<your-github-org>/sites/wknd-ch/public.json \
      --header 'Content-Type: application/json' \
      --header 'x-auth-token: <your-token>' \
      --data '{
        "paths": {
            "mappings": [
                "/content/wknd/ch/:/"
            ],
            "includes": [
                "/content/wknd/ch/"
            ]
        }
    }'
    
  4. Verify that the public configuration of your new site is working by calling https://main--wknd-ch--<your-github-org>.aem.page/config.json and verifying the content of the returned JSON.

Repeat the steps to create additional localized sites. In the case of wknd, you would need to create a wknd-de site for the German presence as well.