Michelle
Michelle

Reputation: 249

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.

Upvotes: 0

Views: 154

Answers (2)

Roman Hutnyk
Roman Hutnyk

Reputation: 1549

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") %>

Upvotes: 0

Brenden Kehren
Brenden Kehren

Reputation: 6117

This is most likely because the user who signed the macro is not in the system any longer. I'd change the macro to simply read:

{%CurrentDocument.DocumentName@%}

Having the @ at the end will say the macro does not need to be signed.

Upvotes: 0

Related Questions