Copied to clipboard

Flag this post as spam?

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


  • Libin Joseph 9 posts 31 karma points
    Jul 10, 2016 @ 23:42
    Libin Joseph
    0

    Check the values in nuPicker

    Hello everyone,

    I have just started using Umbraco after a very long time, and I would appreciate if someone could me help with nuPickers.

    I have implemented nuPickers.XmlPrefetchListPicker in a DocumentType named "Article". When the content-editor creates an article under one of the categories, the nuPicker allows them to select other associated categories (folder) for the article too.

    Eg: When an article is created under the Sports Category, he/she would be listed with all other categories in the nuPicker such as "News", "Current Affairs", "Technology" etc. So if the content-editor wishes to display this article in "Current-Affairs", they could select the same from the nuPicker.

    How do I query all the documents with datatype article and the nupicker has a value ="Technology" selected.

    Here is my code :

    var content2 = help.TypedContent(1048)
                .Children
                .Where(c => c.DocumentTypeAlias == "article")
    
                .Select(obj => new Article()
                {
                    CategoryName = obj.Name,
                    CategoryId = obj.Id,
                    Description = obj.GetPropertyValue<string>("description")
                });
    

    I appreciate if someone could help me with the second where clause

  • Libin Joseph 9 posts 31 karma points
    Jul 11, 2016 @ 05:19
    Libin Joseph
    0

    I have got this working. the following code worked.

    var content2 = help.TypedContent(1048)
                .Descendants().Where(x => x.DocumentTypeAlias == "article" && x.GetProperty("nodePicker").Value.ToStringWithDefault(string.Empty).Contains(parentId.ToString()))
    
Please Sign in or register to post replies

Write your reply to:

Draft