Mark Handy
Mark Handy

Reputation: 1256

Kentico v9 smart search transformation and file descriptions

How can i modify the smart search transformation to also display a file description with results. I assume it's this line that needs to be modified:

<%#SearchHighlight(HTMLHelper.HTMLEncode(TextHelper.LimitLength(HttpUtility.HtmlDecode(HTMLHelper.StripTags(CMS.ExtendedControls.ControlsHelper.RemoveDynamicControls(GetSearchedContent(DataHelper.GetNotEmpty(Eval("Content"), ""))), false, " ")), 150, "...")), "<span class='searchTerm'>", "</span>")%>

The File page type uses 'FileDescription' for the description, and this seems to be getting indexed, i'm just at a loss on displaying this.

Upvotes: 0

Views: 127

Answers (1)

maartenvdh
maartenvdh

Reputation: 176

You need to use FileDescription as column name.

<%# GetSearchValue("FileDescription") %>

So to be complete, here is your code with the FileDescription column added:

<%#SearchHighlight(HTMLHelper.HTMLEncode(TextHelper.LimitLength(HttpUtility.HtmlDecode(HTMLHelper.StripTags(CMS.ExtendedControls.ControlsHelper.RemoveDynamicControls(GetSearchedContent(DataHelper.GetNotEmpty(GetSearchValue("FileDescription"),
> ""))), false, " ")), 150, "...")), "<span class='searchTerm'>",
> "</span>")%>

Upvotes: 1

Related Questions