Copied to clipboard

Flag this post as spam?

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


  • Klaus Bergh 8 posts 76 karma points
    Feb 08, 2016 @ 14:35
    Klaus Bergh
    0

    Getting values from property

    Hi

    I have created an property called year, that is a checkbox property. I use this in a list, so i have a lot of pages that have ex 2007, 2008 and so on marked.

    Can i on some way print all pages that have specific 2008 checked in my templates

    I need to list the pages from each year with the number check

    Hope you all understand what i looking for

  • Daniel 60 posts 174 karma points
    Feb 09, 2016 @ 18:42
    Daniel
    0

    I'm not 100% sure what you want, but I think you can do something like the following:

    var allPages = CurrentPage.Children; //the list of pages you want to check
    var pagesThatIWant = allPages.Select(x => x.GetPropertyValue<Boolean>("ALIAS_FOR_CHECKBOX"))
    

    (this is using "Umbraco.Web")

    -> If the pages are scattered around, you probably want to look into doing search - https://our.umbraco.org/documentation/Reference/Searching/Examine/

Please Sign in or register to post replies

Write your reply to:

Draft