Copied to clipboard

Flag this post as spam?

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

  • Anthony Candaele 1197 posts 2049 karma points
    Oct 13, 2012 @ 16:38
    Anthony Candaele

    check the value of a property on the parent node


    I'm trying to collect all children where the property of the parent has a certain value.

    Anyone knows how I can check if the property of a childs parent has a certain value?

    To make this more concrete:

    I have a document type TargetMarketPage, which is a child of the Parent TargetMarketArea. Every TargetMarketArea node has a property 'targetCategory' which can hold the value 'Homes' or 'Business'.

    for my navigationscript I need to check if the the parent of targetmarketpage has the value "homes" or "business".

    Thanks for your help,


  • Kasper Dyrvig 246 posts 379 karma points
    Oct 15, 2012 @ 11:45
    Kasper Dyrvig

    Hi Anthony,

    I'm not sure I understand the whole picture. But basicly: To check if the parent of the current page has certain value you can do this:

    @if(Model.Parent.travelCategory == "Homes")
      Do homes

    Maybe this can set you on track...

Please Sign in or register to post replies

Write your reply to: