How to change global navigation of a web page but not the site in SharePoint 2010? - 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.

Related

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

link to another controller with hot towel and durandal

I am developing an mvc4 app with multiple spa's.
I am using the hot towel template for my spa.
What I want to do is have a anchor link within my views for a spa go to the index action for another controller, so my users can exit one spa and open another. Not all actions will start a spa some are regular mvc style pages.
I have put code like like the following in my spa html pages:
Navigate to another controller
This will change the url in the browser but always reloads the default html page for the spa. If I hit the refresh button in the browser then if will go to the proper page.
I have been able to put a target on the anchor tag of _parent or _top like:
Navigate to another controller
and it will navigate to the new controller page.
I believe it is something in the durandal framework that is preventing the spa from navigating to the second controller, but since I am just starting to work with this, I am stumped as what I need to change. I think there should be a better way than using the target in the anchor tag, or is that the best option.
I hope that I have understood you correctly. I believe this behaviour is caused my Sammy.js (which the durandal router is currently based on). The default behaviour of Sammy is to hijack all links and process them as regards to the SPA itself.
I didn't like this behaviour for the website I am working on and needed links to other MVC web pages to be possible from within the SPA. What I really wanted is for regular links to just work and hash links to be interpreted as a link to another view within the SPA. So '/controller/action' would go to another web page and '#moduleId' would go to another durandal V/VM.
I found this Sammy option that works for me and set it in my main.js
// This stops Sammy from hijacking regular links
Sammy.Application.prototype.disable_push_state = true;

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.

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

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

Is there a way to remove the site nav from a single page in BigCommerce?

I am creating a landing page where I do not want any navigation and it is injecting the site header HTML. Is there a way to make a landing page without any navigation in BigCommerce? I am using the Corner Stone them.
Your best bet is to duplicate the templates/layout/base.html file, remove the header from there, then create a new custom template in templates/custom/page/ which then references the new layout that doesn't include the header.
You can then assign your page to that new template.