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
    May 08, 2012 @ 12:07
    Fuji Kusaka
    0

    Site map

    Hi,

     Anyone can help me on this?...... i have my site map and would like to display Home instead of the "En".

       if (items.Count(0
         
          
           <ul>
          
                    @foreach (var item in items{
                                    if(@Model.NodeTypeAlias =="Home")     
                                                  {
                                                      <li<href="/">Home</a></li>
                                                                           
                                            }    
                                              
                                              else{
                                                                                             <li>
                                                                                        
                                                            <href="@item.Url">@item.Name</a>
                                                            @traverse(item)
                                                                  </li>
                                                          }
                                                }   
                                                  
                    
           </ul>
            }
    }

     

    at this point my if statement isnt doing anything.

     

    //fuji

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    May 08, 2012 @ 12:44
    Jeroen Breuer
    1

    You're using "Model" instead of "item" inside your loop. This should work:

    if(item.NodeTypeAlias =="Home")

    Jeroen

  • Fuji Kusaka 2203 posts 4220 karma points
    May 08, 2012 @ 13:04
    Fuji Kusaka
    0

    Yes it works. 

       
    @foreach (var item in items{
                                    if(item.NodeTypeAlias =="Home")     
                                                  {
                                                      <li<href="/">Home</a></li>
                                                                    @traverse(item)        
                                            }    
                                              
                                              else{
                                                             <li>
                                                                                        
                                                            <href="@item.Url">@item.Name</a>
                                                            @traverse(item)
                                                                  </li>
                                                }
                                                }    
                                                  


    thanks Jeroen

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies