im fairly new to umbraco (and mvc) so busy learning both while developing a new website. my current task is adding a search functionality to the site. i am planning to use the examine indexer.
i have created a search model with a searchterm property and created my searchbox as a partial view that can be included in my layout structure page.
The model item passed into the dictionary is of type 'Umbraco.Web.Models.RenderModel', but this dictionary requires a model item of type 'Models.SearchModel'.
how should i be trying to render this search box in my layout page?
Maybe you should have a look at the ezsearch package. ezSearch is the easy search solution for your Umbraco MVC websites. It's fast, self contained and completely configurable.
Creating a site search
im fairly new to umbraco (and mvc) so busy learning both while developing a new website. my current task is adding a search functionality to the site. i am planning to use the examine indexer.
i have created a search model with a searchterm property and created my searchbox as a partial view that can be included in my layout structure page.
@model Models.SearchModel
@using (Html.BeginUmbracoForm("SearchResults", "SearchSurface", null, new { @class = "search-form", @enctype = "multipart/form-data" }))
{
@Html.TextBoxFor(x => x.SearchTerm, new{ @id = "search", @name="search", @placeholder="Search" }) <input type="submit" value="Search" class="btnSubmit" />
}
However when i include this in my layout page
<div class="grid_8">
@{ Html.RenderPartial("SearchBox"); }
</div>
i get an error :-
The model item passed into the dictionary is of type 'Umbraco.Web.Models.RenderModel', but this dictionary requires a model item of type 'Models.SearchModel'.
how should i be trying to render this search box in my layout page?
Hi Mark,
Maybe you should have a look at the ezsearch package. ezSearch is the easy search solution for your Umbraco MVC websites. It's fast, self contained and completely configurable.
http://our.umbraco.org/projects/website-utilities/ezsearch
Maybe this could be a good solution for you.
Hope this helps,
/Dennis
thanks i have done i wanted to try and have more control over the search results like what nodes to include and what to boost etc....
i dont think its too tricky as i can handle the form submit in my controller and pass a pagedlsit to my view....
is working on a reply...