Multi If Statement for Document Type Alias

Hi,

Im trying apply a navigation structure depending on the document type alias used.

Im checking if the pages have any children, and then the doc type alias.

Im running in to problems with duplicate nodes.

Any help would be grateful.

Martin

 @foreach (var childPage in home.Children.Where("Visible")) {
if (childPage.Children.Any()) {
    if(childPage.DocumentTypeAlias == "DocType-1" ) { <li class=""><a href="">Doc Type 1</a></li>
    }

    if(childPage.DocumentTypeAlias == "DocType-2" ) { <li class=""><a href="">Doc Type 2</a></li>
    }

    else { <li class=""><a href="">Any Doc Type</a></li>
    }
}
else { <li class=""><a href="">Any Doc Type</a></li>
} }

This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/71548-multi-if-statement-for-document-type-alias