Copied to clipboard

Flag this post as spam?

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


  • patrick 41 posts 93 karma points
    Nov 22, 2012 @ 11:26
    patrick
    0

    Get a list of pages, and sort it on a pre-value in Razor

    Hi,

    How would I sort a list of pages based on a prevalue instead of the text in Razor?

    I created a dropdown datatype, and added items. Each item has a text and a value.
    I added the dropdown datatype property to a documenttype. and now I want to show all items
    sorted by the value of the datatype, instead of the text.

    Lets say I have a documentType 'Instructor' with a property 'Level' (which is a dropdown)

    In code I would have something like:

    var items  = root.Descendents("Instructor").OrderBy("Level");

    This will sort the items based on the level, where level is the text of the prevalue.

    But I want to sort it based on the value.

    Thanks in advance,

    Patrick

     

Please Sign in or register to post replies

Write your reply to:

Draft