Copied to clipboard

Flag this post as spam?

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


  • Christina 127 posts 390 karma points notactivated
    Apr 25, 2018 @ 14:45
    Christina
    0

    duplicated pages in meny with same page id

    Hi have started with umbraco and have a problem My mainmenu shows a page 2times with the same pageid.

      @{
                            var selection = Model.Content.Site().Children()
                                                .Where(x => x.IsVisible());
                         }
                        <ul>
                            @foreach(var item in selection){
                                <li>
                                    <a href="@item.Url">@item.Name @item.Id</a>
                                </li>
                            }
                        </ul>
    

    Can someone help me and explain whats wrong

  • Nigel Wilson 945 posts 2077 karma points
    Apr 25, 2018 @ 19:12
    Nigel Wilson
    0

    Hi Christina

    The above snippet looks fine based on what you have provided.

    Is this code in your main template, or is it in a separate partial view and you are calling the partial from a template ?

    If separate can you also provide the template code ?

    Cheers

    Nigel

  • Christina 127 posts 390 karma points notactivated
    Apr 25, 2018 @ 19:36
    Christina
    0

    Hi Nigel Thanks i have the code in masterpage. I have a root node and the pages under. I printed out the pageId and it's the same for two of the children pages

  • Nigel Wilson 945 posts 2077 karma points
    Apr 25, 2018 @ 19:48
    Nigel Wilson
    0

    Hi Christina

    Can you post the code for your masterpage template please - sorry, should have asked before... :-)

    Nigel

  • Christina 127 posts 390 karma points notactivated
    Apr 26, 2018 @ 05:53
    Christina
    0

    Hi again thanks i deleted the page that was showed tvice. /Christina

Please Sign in or register to post replies

Write your reply to:

Draft