Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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
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
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
Can you post the code for your masterpage template please - sorry, should have asked before... :-)
Hi again thanks i deleted the page that was showed tvice. /Christina
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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.
Can someone help me and explain whats wrong
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
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
Hi Christina
Can you post the code for your masterpage template please - sorry, should have asked before... :-)
Nigel
Hi again thanks i deleted the page that was showed tvice. /Christina
is working on a reply...