Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 24, 2015 @ 14:24
    Fuji Kusaka
    0

    Changing position of Content

    Hi,

    I have the following nodes present under my umbraco site and am trying to change the position of the inactive url.

    Here is how my current structure looks like 

    Parent Node 1
    Child Node 1
    Child Node 1-1
    Child Node 2 (DocType A)
    Sub Child 
    Sub Child
    Child Node 2-2 (DocType A)
    Sub Child

    When am on Parent Node 1 i need to display all the nodes present, but once am on Childe Node 2 we dont want to display Child Node 1 & Child Node 1-1. 

    Only the Childe Node 2 and its Sub Child needs to be listed and also the possibility to Click on Child Node 2-2 which needs to sit at the end of the list.

    Up to this point it works fine but once i click on Childe Node 2-2, i get Child Node 2  which displays First and then the Child Node 2-2 and its Sub Child.

    What we would like is whenever we click on Childe Node 2-2 it displays like this

    Child Node 2-2 
    Sub Child
    Child Node 1-1

    Here is the code am on right now

    List<DynamicNode> LTHRs = Model.AncestorOrSelf(3).Descendants("wlcm").Items;
    
    @if(LTHRs.Where(x=>x.GetProperty("umbracoNaviHide").Value !="1").Count() >0){
    
                                for(int te=0; te <1; te ++){     
                                    foreach(var items in LTHRs){
                                        if(te==1? items.IsAncestorOrSelf(Model): !items.IsAncestorOrSelf(Model)){   
                                            var currHomeLTHR = items.Id== Model.Id ? "class=current" : "";
                                            if(items.IsAncestorOrSelf(Model)){
                                                        <li><a href="@items.Url" @currHomeLTHR>@Dictionary["Welcome"]</a></li>
                                                            if(items.ChildrenAsList.Where(x=>x.GetProperty("umbracoNaviHide").Value !="1").Count()>0){
                                                                <ul class="lux-sub-navi @Library.If((Model.IsDescendantOrSelf(items)), "subNavi", "")">
                                                                    @foreach(var subLTHR in items.Children.Where(x=>x.NodeTypeAlias== "SbPage")){
                                                                        string active = (subLTHR.IsAncestorOrSelf(@Model)) ? "class=current" : "";
                                                                        <li @active><a href="@subLTHR.Url">@subLTHR.Name #</a></li>
                                                                    }
                                                                </ul>
                                                        }
                                                }
                                                else{
                                                    <li><a href="@items.Url">@items.Name ^^</a> </li>
                                                }   
                                        }                                   
    
    
                                        }
                                }
    
    
    
    
    
    
                    }

     

    //fuji

     

Please Sign in or register to post replies

Write your reply to:

Draft