Skip to content

Instantly share code, notes, and snippets.

@BillCacy
Created September 17, 2015 22:47
Show Gist options
  • Save BillCacy/0a81eef04b9099a3a311 to your computer and use it in GitHub Desktop.
Save BillCacy/0a81eef04b9099a3a311 to your computer and use it in GitHub Desktop.
This is the view used to render the search results.
@model YOURNAMESPACE.ViewModels.Common.Components.Search.SearchResultsViewModel
<div class="container-fluid width-90">
<div class="row">
<h1>Search results for &ldquo;@Model.SearchTerm&rdquo;</h1>
@if (Model.SearchResults != null && Model.SearchResults.Any())
{
foreach (var result in Model.SearchResults)
{
<div>
<a href="@result.PageLinkUrl" title="@result.Title">
<h2 class="entry-title">@Html.Raw(result.Title)</h2>
</a>
<div class="entry-summary">
@Html.Raw(result.Content)
<a href="@result.PageLinkUrl" title="@result.Title">...Continue reading<span class="meta-nav">&rarr;</span></a>
</div>
</div>
}
}
else
{
<p>No results matched the search criteria &ldquo;@Model.SearchTerm&rdquo;</p>
}
<div class="row">
<div class="pager">
@Html.Partial(Model.PagingViewPath, Model)
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment