Bugs in siteMapProvider. SiteMenu

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
8/10/2006 9:15:17 AM
Gravatar
Total Posts 18439

Re: Bugs in siteMapProvider. SiteMenu

Actually, I just got some help from Microsoft, I've been emailing with Scott Guthrie and Clay Compton and I think there is an at least workable solution that I can implement easily enough for the next release.

I will have to declare additional SiteMapProviders in web.config even though they use the same code they will have different names like mojosite1, mojosite2... and then programatically assign them to the menu based on the siteid like "mojosite" + SiteID.ToString()

so maybe I will configure like 10 and have documentation how to add more if needed

http://msdn2.microsoft.com/en-us/library/ms178426.aspx has some good info they refered me to.

Quoting Clay,
"To answer your key question:  while it's entirely possible to have more
than one instance of the same SiteMapProvider class in your application
(and the MSDN topic I referred you to shows how to do this
declaratively) there isn't a way to programmatically add providers to
the SiteMap.Providers collection.  If it's possible to know in advance
how many logical sites an instance of your portal solution would need to
maintain, the user could configure a separate SiteMapProvider for each
logical site.  Is that a workable solution?"

This will definitely be better than having to configure additional IIS apps and less server load as well.

Really I would never recommend hosting multiple customers this way, its more professional to keep them separate but I think its good for multiple sites for the same customer or say for department level intranet sites at a company.

I'll try to get this working soon.

Cheers,

Joe
8/10/2006 10:48:57 AM
Gravatar
Total Posts 18439

Re: Bugs in siteMapProvider. SiteMenu

I did a quick test and the solution does work, I'll commit to svn tonight after work.

Joe
8/10/2006 1:00:30 PM
kwa
Gravatar
Total Posts 23

Re: Bugs in siteMapProvider. SiteMenu

I'm glade you got it worked. I was thinking of substituting menu control with DHTML since I'm getting frustrated with it. I can't wait to see the next release.

Bytheway, I'm just trying to get 5 of my websites run on one portal.

Thank for your hard work.

 

 

8/10/2006 1:54:13 PM
kwa
Gravatar
Total Posts 23

Re: Bugs in siteMapProvider. SiteMenu

I'm just so happy now, I got it worked on my desktop too

Good job Joe

8/10/2006 3:37:29 PM
Gravatar
Total Posts 18439

Re: Bugs in siteMapProvider. SiteMenu

Good, glad you got it working too!, here are the changes I made:

in web.config:

<siteMap enabled="true" defaultProvider="mojoSite1">
    <providers>
        <add name="mojoSite1" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite2" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite3" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite4" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite5" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite6" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite7" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite8" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite9" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <add name="mojoSite10" type="mojoPortal.Web.mojoSiteMapProvider" securityTrimmingEnabled="false"  />
        <!--
        This is configured to allow up to 10 sites in a single installation, if you need more you can add more
        and just increment the number part of the name which corresponds to the site id
        -->
    </providers>
</siteMap>

and in Controls/SiteMenu.ascx.cs

...

siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");
                           
                            if (siteMapDataSource != null)
                            {
                                siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteID.ToString();

...

new code in orange

Cheers,

Joe
8/10/2006 4:43:55 PM
kwa
Gravatar
Total Posts 23

Re: Bugs in siteMapProvider. SiteMenu

Amazing, that is exactly what I did.

I'm thinking it would be nice to have it registered in the PortalSetting instead of using siteId + "providerName"

something like: siteMapDataSource.SiteMapProvider = siteSettings.siteMapProviderName;

 

8/10/2006 5:05:07 PM
Gravatar
Total Posts 18439

Re: Bugs in siteMapProvider. SiteMenu

2 problems with that idea

1. it more steps to configure

2. you won't be able to get to that setting without that setting already being there cause you won't have a correct menu without it already being there

also conceptually this is something that should be configured by a server administrator not a site administrator as it must match something in the web.config. Site Administration is complicated enough without adding things that can easliy be messed up by someone. It is really not something that should be configured from the UI in my opinion.

Joe
You must sign in to post in the forums. This thread is closed to new posts.