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 All,
How can I use th typedsearch() in Umbraco 6.0.0. whether as a PartialViewMacro or .cshtml Scripting File
Code that i currently am trying:
@{ string query = Request["q"];}<p>test @query</p><ul>@foreach(var page in @Umbraco.TypedSearch(@query)){ <li><a href="@page.NiceUrl">@page.Name</a></li>}</ul>
Thnx in advance,
Garret
Yes! I am struggeling with that too!
Found it!
<p>test @query</p>
<ul class="search-results">
@foreach(var page in @Library.Search(@query).Where("Visible")){
<li><a href="@page.NiceUrl">@page.Name</a></li>
}
</ul>
Pretty sure you're supposed to use the "Umbraco" helper in version 6, at least in MVC anyway. This works for me:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage@{ var result = Umbraco.TypedSearch("searchterm"); foreach (var page in result) { @page.Name }}
Source:
http://umbraco.com/follow-us/blog-archive/2012/10/30/getting-started-with-mvc-in-umbraco-410.aspx
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Typedsearch in 6.0.0
Hi All,
How can I use th typedsearch() in Umbraco 6.0.0. whether as a PartialViewMacro or .cshtml Scripting File
Code that i currently am trying:
Thnx in advance,
Garret
Yes! I am struggeling with that too!
Found it!
Pretty sure you're supposed to use the "Umbraco" helper in version 6, at least in MVC anyway. This works for me:
Source:
http://umbraco.com/follow-us/blog-archive/2012/10/30/getting-started-with-mvc-in-umbraco-410.aspx
is working on a reply...