Thanks Ishai,

This is sort of what i am working on now, Havnt really considered caching or
security yet but just want to get it working before I add that in. I just
have a couple of questions, Not sure if this is right but could you please
advice if i am on the right track or not and secondly, following this method
how do you make sure that the current site is highlighted in the navigation
bar?

Thanks for your help.


public class CustomSpNavigation :
Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider

{

public override SiteMapNodeCollection GetChildNodes(System.Web.SiteMapNodenode)

{

PortalSiteMapNode pNode = node as PortalSiteMapNode;

if (pNode != null)

{

if (pNode.Type == NodeTypes.Area)

{

using (SiteMapNodeCollection nodeColl = new SiteMapNodeCollection())

{

SPWebApplication web = SPContext.Current.Site.WebApplication;

foreach (SPSite site in web.Sites)

{

SPWeb spWeb = (SPWeb)site.OpenWeb();

nodeColl.Add(new SiteMapNode(this, "key", spWeb.Url + "/default.aspx",
spWeb.Title, spWeb.Description));

}

return nodeColl;

}

}

else

{

return base.GetChildNodes(pNode);

}

}

else

{

return new SiteMapNodeCollection();

}

}

}


On Wed, May 7, 2008 at 10:11 AM, Ishai Sagi <[EMAIL PROTECTED]>
wrote:

>  I was suggesting that you develop a custom SiteMapProvider, most probably
> by inheriting from SPSiteMapProvider or PortalSiteMapProvider
>
> Look at "Implementing Site Map Providers" in
> http://msdn.microsoft.com/en-us/library/bb897739.aspx  which has a nice
> code sample how to override "PortalSiteMapProvider" and add items to it –
> your custom code can then add site collections to it.
>
>
>
> It can be a bit complex at first, but I managed to do what you are after
> in a few hours. The main trick here is security and caching (make sure that
> users only see the menu items they are allowed to see, and cache the data on
> a user level cache).
>
>
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf
> Of *Kanwartej Singh Basrai
> *Sent:* Wednesday, 7 May 2008 09:40 AM
> *To:* listserver@ozmoss.com
> *Subject:* Re: [OzMOSS] Multiple site collection navigation
>
>
>
> Ishai, Thanks for the response. Just to clarify, When you say navigation
> providers, do you mean writing a custom sitemap file and hooking that up in
> the web.config file as per this example
> http://blah.winsmarts.com/2008-1-Implementing_Consistent_Navigation_across_Site_Collections.aspx
>
>
>
>
> Or do you mean, writing a feature that implements SpNavigationProvider and
> override methods like getchildnodes....etc. Not sure pro's and cons about
> either approach but i could only find these 2 ways of achieving this.
>
>
>
> kind regards
>
> Tej
>
> On Tue, May 6, 2008 at 4:55 PM, Ishai Sagi <[EMAIL PROTECTED]>
> wrote:
>
> Tej,
>
> No need to write your own navigation control – you need to write your own
> "navigation provider" and connect it to the built-in control.
>
>
>
> There are many samples for navigation providers on the web – and it is
> pretty easy to modify them to do what you want. I was thinking of writing
> about this, but never got the time.
>
>
>
> *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf
> Of *Kanwartej Singh Basrai
> *Sent:* Tuesday, 6 May 2008 16:01 PM
> *To:* listserver@ozmoss.com
> *Subject:* [OzMOSS] Multiple site collection navigation
>
>
>
> Hi Guys,
>
>
>
> We have a web application which has multiple site collections. The client
> wants a navigation which shows consistent navigation on all the site
> collections. So instead of having Home and sub sites in the navigation they
> want to display all the site collections. Is there an easy way to do this in
> moss or do you have to write your own navigation control?
>
>
>
> Would really appreciate any help i can get.
>
> Thanks in advance
>
>
>
> Tej
>
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 269.23.9/1416 - Release Date: 5/05/2008
> 17:11 PM
>
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com
>
>
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com
>
>  No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 269.23.9/1418 - Release Date: 6/05/2008
> 17:17 PM
>
>  -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com
>



------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.

Powered by mailenable.com

Reply via email to