Sitecore XM Cloud - Multiple repository and multi language solution - Nextjs and Aspnet core - Part 2

 Our previous article detailed how to enable the new Project Beta feature, offering support for multiple repositories and programming languages within a single project. Following that, we established two separate environments, leveraging distinct repositories (the Next.js Starter Kit and the ASP.NET Core Starter Kit from our GitHub). 

To finalize the XM Cloud setup for these environments, Metadata Editing must be configured.

As detailed in our previous article, the Next.js application was configured with the default Editing Host options during its initial project setup, thereby providing automatic Metadata Editing capabilities. In contrast, for the ASP.NET Core application, we have created its environment but omitted the creation of an Editing Host. 

The screenshot below shows that only a single Editing Host is currently configured, dedicated to Next.js.


To switch from the default Editing Host provided by the Starter Kit for Next.js, simply follow the steps below to enable an alternative Editing Host for your Next.js application.


  • Upon completion of the above steps, the Editing Host details for Next.js will be configured, and its JSS Editing Secret will be reflected in Sitecore.JavaScriptServices.ViewEngine.Http.Config file, visible within the Authoring Environment's Showconfig file. With this JSS Editing Secret configured, metadata editing will function automatically for the Next.js application.







  • While we have successfully created an Editing Host for the Next.js application, attempting to do the same for an ASP.NET Core application by linking its authoring environment and selected repository will not work. This is because the current ASP.NET Core GitHub repository does not support internal metadata editing using this approach.
  • So, how can we enable Metadata editing for ASP.NET Core in this new beta project creation method? Previously, with the older project and environment creation process, this feature worked seamlessly without any additional steps.

    However, it appears that with this new beta approach to project creation, we no longer need to create an Editing Host and link it to the Authoring Environment to enable this functionality

  • For ASP.NET Core, you can enable metadata editing simply by retrieving the JSS Editing Secret value from your ASP.NET Core Sitecore XM Cloud instance's Authoring Environment's Showconfig file and then updating your ASP.NET Core application's appsettings.config file with this value, as shown below





Note:
  • Projects created before enabling the beta feature do not support multi-repository or multi-language configurations. For these existing projects, there is no need to create separate Editing Hosts for either Next.js or ASP.NET Core applications.
  • Always use Preview Context Id for metadata editing, don't use Live Context Id
  • If the Site is deployed to Azure for an ASP.NET Core application or using local DEV tunnels, we can configure the default Editing Host by providing the details below.



Let's learn and grow together, happy programming 😊

Comments

Popular posts from this blog

Sitecore Upgrade from 8.1 XP to 10.4 XM Scaled - Part 1

Custom Item Url and resolving the item in Sitecore - Buckets

Sitecore Custom Rule (Action and Condition)