Sep 19, 2008

But hey, we're not Adventure Works!

Using and editing the alternative master pages of MOSS, situated in the Master Pages and Page Layouts gallery on a site collection, is a handy get-away to a different look of the MOSS site without too much handy-work to be done. Oh, okay, the css-style-stuff is always rather time-taking and sometimes downright frustrating, but it's still easier than building your own master page alltogether. Maybe.

Anyhow, some of those master pages, e.g. OrangeSingleLevel.master, contains example data labeled Adventure Works. For example, the "logo" in this specific master, is text instead of a logo image file, so changing the logo file on the server does no good to changing the company name on the page.



We're down to three options, a couple simpler ones and one involving a little bit of coding. I'm not going into the coding-scenario in this entry, maybe later on in another one, but let's take a look at the two simpler possibilities.

First one is to simply delete alla the AdventureWorks related data on the master page. In addition to the company name, e.g. this particular master page contains address and phone number etc. data in the bottom of the page.



This, and the company name at the top of the page, are rendered to the page by an asp-control via an resx-file that contains the data shown.


(code not an actual excerpt but as listing of the asp-control references)

Deleting these controls in the ht
ml-code rids you of the AdventureWorks -based data for good and you can add your own logos and text straight to the html-code.

But, you might as well want to modify the data provided to the page by editing the resx-file containing the data. The files are cms_[LCID].resx resource files and their originals are situated in SharePoint HIVE\CONFIG\Resources (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG\Resources).

Anyhow, each web application uses a set of copies of these files, so the actual files to modify are situated in the C:\Inetpub\wwwroot\wss\VirtualDirectories[Port]App_GlobalResource. Thus, the options are to modify the original files (for further use also, e.g. when new web applications are created) and copy these files to the App_GlobalResources, or to modify the web application specific files
.

The data to modify is inside the data-elements with name-value same as the asp-reference shown above, e.g.



The cms_[LCID].resx-files can be opened to e.g. Notepad for editing. Change the value for each data and you have your own company information on the master page.

2 comments:

Jason Sherry said...

Thanks for posting this, with detailed info. Was driving me nuts trying to figure out where SharePoint was getting this info from!

Anonymous said...

Thanx for the post. Very helpful.