Copied to clipboard

Flag this post as spam?

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


  • Clickfarm 77 posts 161 karma points
    Jan 29, 2015 @ 23:13
    Clickfarm
    0

    get pages with specific property value

    If I have the following code:

        var myPages= Model.Content.Parent.Children

            .Where(p => p.IsVisible())

            .Where(p => p.ContentType.Alias == "MyDocumentType")

            .OrderByDescending(p => p.CreateDate)

            ;

    what can I add to this to get pages that have a specific property values?  more specifically, i have a property of type "Tag" on these pages and i want to get a list of pages that have a certain tag.
    alternatively, is there a different/better way of doing this?
    thanks!
  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 29, 2015 @ 23:27
    Dennis Aaen
    1

    Hi Matt,

    Try to see this, I think it what you are looking for. http://our.umbraco.org/forum/developers/razor/54106-Razor-query-to-retrieve-pages-by-document-type-and-property-value

    If you go directly to the solution there is an Razor strongly typed example.

    Hope this helps,

    /Dennis

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 31, 2015 @ 00:11
    Dennis Aaen
    0

    Hi Matt,

    Could you use the link as inspiration on how to get pages with specific property value.

    /Dennis

  • Clickfarm 77 posts 161 karma points
    Jan 31, 2015 @ 00:14
    Clickfarm
    0

    I'll take another look at it monday but the first time I tried it was throwing an error.

Please Sign in or register to post replies

Write your reply to:

Draft