Copied to clipboard

Flag this post as spam?

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


  • Mark 3 posts 23 karma points
    Jul 03, 2012 @ 13:08
    Mark
    0

    Orderby subquery?

    I have a list of accommodation nodes with room types as child nodes. For example:

    Hilton Hotel
     - Standard Room
     - Deluxe Room

    When I output the hotels using a foreach loop I can orderby properties of the hotel such as name and star rating but how would I go about sorting based on the price, which is held in the room type nodes?

    Thanks in advance for any help :)

    Mark

  • Mark 3 posts 23 karma points
    Jul 03, 2012 @ 13:11
    Mark
    0

    in umbraco v 4.7.2

  • gilad 185 posts 425 karma points
    Jul 03, 2012 @ 13:14
    gilad
    0

    Hi Mark,

    I think you should create Dictionery List with nodeId , your price based on type nodes.

    When run trow all node with foreach you can add item with nodeId , price value based on typeNode.

    Then you can order this list by the value and run trow with forEach again.

    Hope that help. Cheers

  • Mark 3 posts 23 karma points
    Jul 03, 2012 @ 14:51
    Mark
    0

    Thanks, I got it working as per your suggestion :)

Please Sign in or register to post replies

Write your reply to:

Draft