Forum Discussion
Lindsey, This will only work when you have same type of text-key available in text-editor. Without adding text-keys, you cannot set title using context-object page.content.head.setTitle.
Lets suppose in below code when you split "selectedLabels" and there will be two labels with label names "label1" and "label2".
<#assign labelListParam = webuisupport.path.rawParameters.name.get("forum","")>
<#assign selectedLabels = labelListParam?split(",")/>
So for "forums" cutom page your text-key for the title will be:
page.forums.label1.title = The Title of the page with name label1
page.forums.label2.title = The Title of the page with name label2
- Lindsey6 years agoLeader
Parshant could you just do page.forums.title = {0} for the text property, and add the labelsPageTitle variable as the parameter in the text property value?
So it'd be${page.content.head.setTitle(text.format("page.forums.title", labelsPageTitle)}
?
- Lindsey6 years agoLeader
Parshant I tried it as mentioned in my previous comment, and it does not work. Is there not a way to have variables in the title tag text property?
- Parshant6 years agoBoss
Hi Lindsey ,
In khoros ".title" text-keys, we can change the keys name dynamically while passing to text-format keys, but can't change its value with dynamic parameters.
This can only work like this:
<#assign dynamicLabel = "testpage" />
text.format("page.forums. " + dynamicLabel+ ".title")
Your text-key need to be like below.
page.forums.testpage.title = Title of the Test Page
Related Content
- 2 years ago