SharePoint: Programmatically moving pages and subsites on the current navigation menu - sharepoint-2010

Does anyone know how to programmatically move/order the pages and subsites that appear in the Current Navigation when you have the Include subsites and include pages options ticked/enabled?
Background
I have written a class (in c#) which imports content into a new SharePoint site. The newly created subsites and pages all show on the Current Navigation menu as expected, but in the order they were created (I assume). I need to manually sort the pages on the menu so that they appear in the same order as the existing non-SharePoint site.
Issue
The PublishingWeb.Navigation.CurrentNavigationNodes collection does not contain any SPNavigationNode items for the pages and subsites that are automatically displayed on the Current Navigation menu, so I can't use this collection.
I know that to hide a particular page from the menu, you have to update a web property as follows:
web.AllProperties["__CurrentNavigationExcludes"] += page.UniqueId.ToString() + ";";
web.Update();
Is there something similar I can use to order the pages?

Set the Ordering to manual
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.orderingmethod.aspx
Check out the follow up article on this: http://www.thekickboard.com/archive/2010/09/01/programmatically-setting-navigation-order-in-a-moss-publishing-site.aspx

Is this sort of what you are looking for:
http://www.thekickboard.com/archive/2010/09/01/programmatically-setting-navigation-order-in-a-moss-publishing-site.aspx

Related

TYPO3: login form on page + sub pages

In TYPO3, how do I get a login form to be the first rendered content element on a page and all its sub pages? I tried to check the "recursive" option but that doesn't seem to do the trick?
There are quite a few ways to set up something like this. Here's one approach:
Add a separate content section in your backend layout right above the current section.
Use slide to have pages inherit content for this section from their parent pages
Put the login form in that section on your the root page of your subtree.
This rather simple approach leaves control to the editor.
The recursive option you mentioned is very likely related to the record storage page and tells TYPO3 to look for records (here: users) in subpages of the selected page.

Global navigation is disappeared from a site

Like the title says, Global navigation is disappeared from a site. SharePoint server publishing feature is active on both site level and site collection level. Can somebody help here?
You may still need to update 'Global Navigation' option under 'Site setting > Navigation' for each subsite and Site collection after the feature is activated.
Note: The option selected for subsite and site collection could be opposite, to display the same navigation in all levels.
E.G. Site collection should have "Display the navigation items below.." whereas subsite shoul have "Display the same navigation items.." (with "Show subsites" selected for both)

Piranha CMS UI menu returns empty on post page

I have the default template menu from the piranha install. It works very well for all the pages of the site, but when it comes to viewing individual post pages the menu bar is empty, even when I specifically define root node as the startpage of the site.
Why is this? Can I make UI.Menu output the same html as on the other pages of the site in any way?
If you specify a root node, or start level for the menu, that page, or a child of the page has to be active in order for the menu to render. This is the logic that enables you to easily render submenus by typing:
#UI.Menu(StartLevel: 2)
When you render a post you don't have a selected position in the site map, so rendering the menu from a certain root node will most likely return empty. However, rendering the level without a root node should give you a menu, for example:
#UI.Menu(StopLevel: 2)
To help you out I need to know just how you're invoking the menu-helper from you .cshtml file.
Regards
HÃ¥kan

How to change global navigation of a web page but not the site in SharePoint 2010?

I created a web page with a custom page layout, the site the page is within has global navigation set to "Display the same navigation items as the parent site" and it was all good. I have now got the requirement to change the items in the global navigation for the page but keep the old setting for the site, how can I achieve this?
For a site I can go to site settings -> navigation and change the links as I like but the page is dependent on the site it is within. I don't have to start over and create a new site do I (instead of a simple page)?
Thanks in advance.
Unless you do some kind of trickery (like Javascript embedded in the page) to do otherwise, the navigation settings are shared for all pages within the site.
If you wanted to get rid of global navigation for a particular page, you could customize your master page to put a special CSS class on the element wrapping it, and use some CSS inline on that page (ie. in a content editor webpart) to hide it.

Welcomepage is missing from Quicklauch

I'm using a publishing web. I have two pages. The navigation is set to show pages.
It shows two menu items, for each page one item.
The problem:
When setting publishing page 1 as the welcomepage, this page is removed from the quicklaunch navigation.
Probable cause:
The PortalSitemap providers filters the welcomepages from quicklaunch. Probably because the web has the same url as the welcomepage?
Any thoughts about this and how to fix this by configuring the provider?
At this moment I added a (external) node...
Try to add page to navigation directly.
Site Settings => Navigation
you can use a little trick.
This happens because sharepoint removes the welcome page from the quicklaunch. But if you set the welcomepage with a different URL its appears.
for Ex: if you want the page "XPTO.aspx" to be your welcomepage, set it as "XPTO.aspx?".
this way the page will be set as welcomepage, and it will appear on quick launch .
this happens beacul sharepoint thinks that "xpto.aspx" and "xpto.aspx?" ate 2 different pages, but they are not.