-
Hello, "Search-Result.liquid" renders the "Summary" templates based on Results contentype. I'have a NewsItem custom contentype with its summary template: "Content-NewsItem.Summary.liquid" I want a specialized template just for Search-Result page. How can i call it? I tried "Search-Result-NewsItem.Summary.liquid" but the page always calls "Content-NewsItem.Summary.liquid" Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Good one. I need to check. |
Beta Was this translation helpful? Give feedback.
-
As quick workaround, I believe you can change ”Summary” to specialized shape for your NewsItem content type in e.g. following change will call view <ul class="list-group">
@foreach (var contentItem in Model.ContentItems)
{
var displayType = "Summary";
if (contentItem.ContentType == "NewsItem")
displayType = "NewsItemSummary";
<li class="list-group-item">
@await DisplayAsync(await DisplayManager.BuildDisplayAsync(contentItem, null, displayType))
</li>
}
</ul> |
Beta Was this translation helpful? Give feedback.
Search-Result.cshtml
creates Display shape for summary for all content items,@await DisplayAsync(await DisplayManager.BuildDisplayAsync(contentItem, null, "Summary"))
As quick workaround, I believe you can change ”Summary” to specialized shape for your NewsItem content type in
Search-Result.cshtml
.e.g. following change will call view
Content-NewsItem.NewsItemSummary.liquid