title | description | author | ms.date | ms.topic | audience | ms.reviewer | ms.search.region | ms.author | ms.search.validFrom | ms.dyn365.ops.version | ms.custom | ms.assetid |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Change theme module strings |
This article describes how to change module library strings from within a theme in Microsoft Dynamics 365 Commerce. |
samjarawan |
03/08/2022 |
article |
Developer |
v-chgriffin |
Global |
samjar |
2019-10-31 |
Release 10.0.5 |
[!include banner]
This article describes how to change module library strings from within a theme in Microsoft Dynamics 365 Commerce.
In some cases, modules expose strings that are shown as configurations in a module that can be configured in Commerce site builder. However, other strings, such as the text that is shown for the sign-in button, might be hardcoded as module resource strings.
To override resource strings for a theme, use the pattern in the following example to modify the global.json resource file that is located in the src/resources/modules directory.
"{ThemeNamespace}.{ThemeName}.{ResourceString}": {
"value" : "",
"_value.comment": ""
}
To learn more about how resource strings are created and how to create a global.json file if one doesn't exist in your software development kit (SDK), see Localize a module.
To override resource strings for preinstalled themes (for example, fabrikam or starter themes), use @msdyn365-commerce-modules as the theme namespace. The following example shows how to change the sign-in link text for the fabrikam theme.
"@msdyn365-commerce-modules.fabrikam.signInLinkText": {
"value": "Sign in now",
"_value.comment": "Sign-in Link Text"
}
For custom or local themes, use __local__ as the theme namespace. The following example shows how to change the sign-in link text for a custom theme that is named "adventureworks."
"__local__.adventureworks.signInLinkText": {
"value": "Log in",
"_value.comment": "Log in Link Text"
}
Note
For shared themes, child themes inherit all the resources string overrides that are linked to the parent theme.
Add module configuration fields
Test modules by using module mocks
Test modules by using page mocks
Create a layout container module
Create a page container module
[!INCLUDEfooter-include]