Case-sensitivity/ Not-synchronized of PublishingPage.ServerRelativeUrl & Site Wellcome Page Url on Publishing Sites

So, you decided to make your own custom site-map, following your logic.

Yes, I know you could just use the CQWP and have one pretty fast, but…its exactly where those tinny-neat details when the customer is just asking:

1. ”Do no display the current site, and instead hide “home page” of all sites and show the site name as links, etc.” or…

2. “Show on X columns (of which i can specify myself), but make sure child sites, parent site, add some indent, and..yeah…add also our custom page abstract/ site description, but also apply all the rules in the 1st requirement!” or….

3.”Make sure you allow me to only display XX sites down, but no more, and allow me to toggle display of Sites/Pages!”.

….and many more, well in that case you would like to take things into your own hands and start leveraging those skills in retrieving data, preparing, interpreting settings.

To give just a hint, I’ve been using the CrossListQueryInfo and its counterpart CrossListQueryCache, (please remember that we are using MOSS and Publishing sites, the main issue here is that these 2 classes only exist in MOSS, and 2ndly, the PAGES libraries are available on Publishing Sites) along with some LINQ and generic classes, so that information could be accordingly grouped following my needs, and cached later on.

Now, one issue i found is that the Wellcome page (you can find this in Site Settings-Welcome Page) is not updated every time you change de name of the home page via the Pages Library (go on Site Settings-All Site Content-Pages, select Edit Settings on the page you previously used as the Welcome page, and only change from Default.aspx to default.aspx).

PublishingWeb _pWeb = PublishingWeb.GetPublishingWeb(_web);

                    SPFile _defaultPage = _pWeb.DefaultPage;

If you interrogate using _defaultPage.ServerRelativeUrl is showing the setting that you changed via Welcome Page option, obviously different than the one in PAGES Library. So be aware of this little inconvenient if you plan to compare strings.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s