Copied to clipboard

Flag this post as spam?

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


  • Christina 111 posts 344 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 939 posts 2061 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 111 posts 344 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 939 posts 2061 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 111 posts 344 karma points notactivated
    Apr 26, 2018 @ 05:53
    Christina
    0

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

  • 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