I'm attempting to use a Content Token named BrandName
in a Page Title
field in a multi-site headless solution (Sitecore 10.1.1 Headless 18). The hope was that I could setup the Standard Values for the field as follows: $name | $(BrandName)
. This would replace the $name
token with the name of the Route item and the $(BrandName)
token with the value specified within the Data folder of the site.
Based on the SXA documentation
The logic of content tokens replacement is implemented in the RenderContentToken processor of the renderField pipeline. You can reference a content token in a rich text, single-line text, and multi-line text field by using the $ key and the name of the content token in parentheses.
I have confirmed that this does work as expected with Rich Text fields, but not with Single Line Text or Multi-line Text fields.
In my example below, the token key is BrandName
and the value is Super Huge Brand
. The Route name is Home
.
{
"sitecore": {
"context": {
"pageEditing": false,
"site": {
"name": "Super Huge Brand"
},
"pageState": "normal",
"language": "en",
"itemPath": "/"
},
"route": {
"name": "Home",
"displayName": "Home",
"fields": {
"Page Design": {
"id": "640c1013-1a08-4301-bdae-324e0953b5fd",
"url": "/sitecore/content/Client A/Super Huge Brand/Presentation/Page-Designs/Primary-Page-Design",
"name": "Primary Page Design",
"displayName": "Primary Page Design",
"fields": {
"PartialDesigns": {
"value": "{79FDD9F5-E3ED-4597-BB59-C8C4E8187D10}|{3232D922-6C2E-447C-834D-50E5D1EE8A86}|{D3FFF78A-284E-4135-B826-FD91E8505DBB}|{7296CF96-E7F6-4F04-84C0-032592C57BCF}"
}
}
},
"PageTitle": {
"value": "Home | $(BrandName)"
},
"RichPageTitle": {
"value": "Home | Super Huge Brand"
},
"MultiLinePageTitle": {
"value": "Home | $(BrandName)"
}
},
"databaseName": "web",
"deviceId": "fe5d7fdf-89c0-4d99-9aa3-b5fbd009c9f3",
"itemId": "706a68e8-349c-4a5d-bd38-38f0766171b1",
"itemLanguage": "en",
"itemVersion": 1,
"layoutId": "9a4810a8-5fd1-42ac-97d8-4ad65b56c7ed",
"templateId": "34e6c385-eb0d-4858-b173-8b0cbc919149",
"templateName": "App Route",
"placeholders": {}
}
}
}
My question is: Am I doing something wrong or is this a bug that I need to log with Sitecore?