Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Roma 18 posts 38 karma points
    Apr 08, 2015 @ 05:50
    Dan Roma
    0

    Tagging Checkboxlist used to filter items

    I'm trying to get a list of items whose checkboxlist(ArticleTagTypes) match the querystring but not when #all. It doesnt seem to work. I think its my where clause in my second selectedArticles def but not sure. Also, I keep getting errors for the Split and Contains functions. Any Ideas?

     

    var articles = Umbraco.Content(1096);

    var paging = Paging.GetPages(articles.Children.Count(), 2);

    var selectedArticles = articles.Children.OrderBy("CreateDate").Where("Visible").Skip(paging.Skip).Take(paging.Take).ToList();

     

        if (Request.QueryString["tag"] != "all")    {

            selectedArticles = articles.Children.OrderBy("CreateDate").Where("Visible && ArticleTagType.Value.ToString().Split(',').Contains(@0)",Request.QueryString[""]).Skip(paging.Skip).Take(paging.Take).ToList();

        }

    }

Please Sign in or register to post replies

Write your reply to:

Draft