Copied to clipboard

Flag this post as spam?

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


  • Darren Wilson 238 posts 646 karma points
    Sep 29, 2016 @ 10:39
    Darren Wilson
    0

    Listing Nodes that match radiobutton

    This is a real noob question - sorry for asking it but I'm stumped - basically I'm just trying to list nodes that have a radio button selected - here's my code:

    @{
                    var selection2 = CurrentPage.Site().Children("vacancy").Where("vacancyLocation == \"Borders\"");
                }
                <ul>
                    @foreach(var item in selection2){
                        <li>
                            <a href="@item.Url">@item.Name</a>
                        </li>
                    }
                </ul> 
    

    What am I doing wrong?

    Darren

  • Gary 80 posts 377 karma points
    Sep 29, 2016 @ 10:57
    Gary
    0

    You would just need to use the Where clause to select that field to either true or false..

    Here i have done so to use certain News items as "Featured Items":

    var selection = CurrentPage.Parent.Children("newsItems").Where("featuredNewsItems == True").OrderBy("CreateDate desc");
    

    Hope this helps..

    p.s. we all love pie and dirty mash

  • Darren Wilson 238 posts 646 karma points
    Sep 29, 2016 @ 11:04
    Darren Wilson
    0

    Ha ha - Cheers Gary!

    Hope all is well with you - as you can see I've not progressed much since our training! I'll give this a try.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies