how to add additional title to the existing template | Community
Skip to main content
Level 2
September 17, 2020
Solved

how to add additional title to the existing template

  • September 17, 2020
  • 1 reply
  • 736 views

Hi, 

Can  some help me to how to create a  ,Auto-populate Page Title for under the somepages) example ..  Example ("Title" | sometext).  

post with some sample too, I have created a new title component and trying to referring the page , it not working as expected.

 

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by santhosh_kumark

Hi @gavya ,

 

Try to get that title dynamically using any page model and call it in clientheaderlibs.html file of your template referring page component. It does work. sample code snippet below:

<sly data-sly-use.pageModel="com.aem.community.core.models.PageModel"></sly>
<title>${pageModel.title} | sometext</title>

 

 

1 reply

santhosh_kumark
santhosh_kumarkAccepted solution
Level 6
September 17, 2020

Hi @gavya ,

 

Try to get that title dynamically using any page model and call it in clientheaderlibs.html file of your template referring page component. It does work. sample code snippet below:

<sly data-sly-use.pageModel="com.aem.community.core.models.PageModel"></sly>
<title>${pageModel.title} | sometext</title>