I want to know how would I apply filters in my card list If my data comes from query builder.
@{
var Id = Request.RawUrl; //Gets value from url
if (Request.RawUrl.Contains("?maker="))
{
var tempID = Id.Split('?').Last(); //splits unnecessary characters
string[] data = tempID.Split('&');
string maker = data[0].Split('=').Last();
string body = data[1].Split('=').Last();
string keyword = data[2].Split('=').Last();
}
var selection = Umbraco.Content(Guid.Parse("3758071d-10c8-4890-b680-64f43a7b4149"))
.Children("vehicles")
.Where(x => x.IsVisible())
.OrderByDescending(x => x.Id);
int pageSize = 6; // Number of News per page
int page = 1; // The page we are viewing
if (!int.TryParse(Request.QueryString["page"], out page))
{
page = 1;
}
var totalNodes = selection.Count();
int totalPages = (int)Math.Ceiling((double)totalNodes / (double)pageSize);
if (page > totalPages)
{
page = totalPages;
}
else if (page < 1)
{
page = 1;
}
I would look into using Examine for filtering your data. Especially if you have a lot of items in your DB.
Examine (or rather Lucene) is the search engine which Umbraco uses to index all items. It is super fast.
Filter On Given card list
Hello All,
I want to know how would I apply filters in my card list If my data comes from query builder.
}
Would it work by adding an extra where condition?
I would look into using Examine for filtering your data. Especially if you have a lot of items in your DB. Examine (or rather Lucene) is the search engine which Umbraco uses to index all items. It is super fast.
is working on a reply...