Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Im using a standard page search but my search results are returning #. Looks like it can't get the URL for the node. The search does return the page ID and a property from the page okay.
@if (!string.IsNullOrWhiteSpace(searchQuery)) { var results = publishedContentQuery.Search(searchQuery); long resultCount = results != null && results.Any() ? results.Count() : 0; @Html.Raw(string.Format(Umbraco.GetDictionaryValue("Search.Results"), resultCount, searchQuery)) if (resultCount > 0) { <div> <p class="text-lg">Your search for <span class="font-normal text-bright-blue text-xl uppercase text-left tracking-wide">@searchQuery</span> returned <span class="font-normal text-bright-blue text-xl uppercase text-left tracking-wide">@results.Count() </span>results.</p> </div> foreach (var result in results) { <li class="bg-[#F0F7FF] hover:bg-[#007AFF]" data-aos="fade-up"> <a href="@result.Content.Url()"> <div class="group flex flex-col md:flex-row p-10 h-full text-dark-blue hover:text-white items-center justify-between"> <div class="block md:flex justify-between items-center max-w-full w-full"> <div class="capitalize"> <h3 class="mr-5 block"> page iD: @result.Content.Id; <br><br> @(result.Content.HasProperty("title") && result.Content.HasValue("title") && !string.IsNullOrWhiteSpace(result.Content.Value<string>("title")) ? result.Content.Value("title") : result.Content.Name) </h3> @if (result.Content.HasValue("pageExcerpt")) { <p class="mt-3 mb-0 normal-case">@Html.Truncate(result.Content.Value<string>("pageExcerpt"), 200)</p> } </div> </div> </div> </a> </li> }
Any ideas as to why this might be?
Did u find an answer for this?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
@result.Content.Url() returns #
Hi,
Im using a standard page search but my search results are returning #. Looks like it can't get the URL for the node. The search does return the page ID and a property from the page okay.
Any ideas as to why this might be?
Did u find an answer for this?
is working on a reply...