Search code examples
kentico

Kentico - Dynamic Page Title Not Display Correctly in Smart Search Results


I used {% CurrentDocument.DocumentName %} in the Metadata > page title field. The Title tag displays ok when viewing the article itself on the browser; however, when searching through Smart Search, the results output something like below in place of the Title. I'm not sure why, is there a way to fix this? Thanks!

{% CurrentDocument.DocumentName |(user)myLogin|(hash)9f2b69705f777e8a884a107dfb72f681d8eb99867b6967514dbdca851b7f4309%}

Note: This is for hundreds of article pages, and inheriting Page Title from Parent by using the macro work best for me.


Solution

  • What is your transformation for search results? How do you retrieve that value?

    I can see two possible approaches to solve your issue:

    • go to page type -> search fields and select DocumentName as a value for Title field
    • adjust search results transformation and use <%# GetSearchValue("DocumentName") %> instead of <%# Eval("Title") %>