Sitecore: What determines which XTM project templates are available during content submission to XTM Cloud?
Introduction
XTM Connect – Sitecore enables the use of XTM Cloud project templates for submitting Sitecore content to XTM Cloud for translation. This is similar to many other third-party CMS integrations that XTM Cloud offers.
However, there might sometimes be a situation in which you cannot see a particular XTM Cloud project template in the Sitecore CMS, even though you have imported the templates from the XTM Cloud Settings section, in the XTM connect settings correctly, using the Get templates action, and you see the system message that XTM templates are up to date, no new templates were added.
There is a particular reason for this, which is explained below.
Requirements
There are two vital requirements that need to be met for templates to be displayed and selectable in the Sitecore CMS.
Customer
The most important condition for displaying a particular XTM Cloud project template in the Sitecore CMS is whether the template in question is set as global or customer-specific, in XTM Cloud. The template itself needs to be configured on the XTM Cloud side first [Templates → (select a relevant template) → General info → Customer].
Then, all the templates that are set to Global will be imported to the Sitecore CMS when you click the Get templates button in Sitecore.
When it comes to customer-specific configuration, a template must linked with an XTM Cloud Customer which has been used for the XTM connector integration, as defined in the XTM Cloud customer ID field in the XTM Cloud Settings section of the XTM connector settings. If you select any other XTM Cloud Customer in the template configuration, the template you select will not be imported into the Sitecore CMS.
Project template name character restriction
The second condition for displaying a particular XTM Cloud project template in the Sitecore CMS is that the template’s name must match a particular character pattern, which looks like this:
^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$ |
In other words, the pattern above does not permit the use of these characters: \, /, :, *, ?, ", <, >, |, {, }. Nor does the pattern permit the use of characters that are not supported by XML format.
If an XTM Cloud template name contains some invalid characters, a message will be displayed when you click the Get templates button in Sitecore and the template itself will not be imported.
Also, at this point, an error message will be displayed in the Last Export folder (To display it, see sitecore → Content → XTM Translation. (For more details, see the following article: Sitecore: Troubleshooting instructions):
CommunicationException during GetXtmTemplates. Sitecore.Exceptions.InvalidItemNameException: An item name must satisfy the pattern: ^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$ (controlled by the setting ItemNameValidation) at Sitecore.Data.Items.ItemUtil.AssertItemName(Item destinationItem, Item sourceItem, String name) at Sitecore.Data.Items.Item.Add(String name, TemplateID templateID) at Xtm.Connector.Sitecore.Common.Helpers.UpdateItem.CreateItem(String itemName, Item parentItem, TemplateID templateId, List`1 updateProps) at Xtm.Connector.Sitecore.Common.Helpers.XtmTemplatesGetter.AddNewTemplate(XtmTemplateItem xtmTemplate, Item xtmTemplateFolder) at Xtm.Connector.Sitecore.Common.Helpers.XtmTemplatesGetter.CreateSitecoreItemsFromTemplates(IList`1 templateList) at Xtm.Connector.Sitecore.Import.GetXtmTemplates.TemplatesFromXtm(Int64 customerId)
For these reasons, ensure that your project template’s name complies with the required pattern, in XTM Cloud (To do so, select [Templates → (select a relevant template) → General info → Name].)
Template names are updated automatically according to the updates made in XTM Cloud.