Add the language selector to the product details page
To view the translated name and description of your product in Sitecore Content Hub, you can add a language selector to the product detail page.
Only make manual changes to page components using the Entity Manager in exceptional cases such as the set up of the language selector.
To add the language selector to the product details page:
-
On the menu car, click Manage.
-
On the Manage page, click Pages.
-
In the left pane, enter Product details in the search box and click Search.
-
In the left pane, click Product details.
-
On the Product details page, on the Layout tab, in the HEADER ZONE (RIGHT), click Add component.
-
In the Add component dialog box, enter HTML in the search box and click Search.
-
In the component list, click HTML.
-
In the Add component dialog box, do the following:
-
For Title, enter Language selector.
-
Click the Visible switch to make it active (On).
-
Click Add.
-
-
On the Product details page, take note of the page Entity ID displayed in the URL of the address bar.
-
Open a new browser tab and paste the following URL with your specific Content Hub URL and page entity id:
RequestResponsehttps://<Your Content Hub URL>/en-us/admin/entitymgmt/entity/<Page entity id>
-
On the product details Entity detail page, click the General tab, and scroll down to the Page components section.
-
Click Language selector.
-
On the Language selector Entity detail page, click the General tab, and click Edit
.
-
Update the following:
-
For Data, click Switch editor mode, select Text, and enter the following code:
RequestResponse{ "controls": [ { "type": "Details.Controls.LanguageSelector" } ] }
-
For Component, remove HTML and add Raw.
-
-
Click Save. The Language component settings for Data and Component are updated as shown in the following example.
The language selector is now visible on the product detail page.