in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

tigirry's SharePoint Blog

July 2007 - Posts

  • Easy way of Editing Customized Theme in MOSS 2007

    Recently, I have observed that many MOSS 2007 and/or WSS 3.0 administrators want to apply their custom theme to site collections. In my opinion, this is a good practice because you never want to edit the "core.css" file - it is just stupid :) For those who still want to modify the "core.css" file in spite of my advice, the file is in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES folder".

    When using SharePoint Portal Server 2003, you could easily test and apply your customized .css file by inserting a html tag after

    <Link REL="stylesheet" Type="text/css" HREF="/_layouts/1033/styles/ows.css">

    in <HEAD> section of .aspx files. "Ows.css" file in SharePoint Portal Server 2003 was the "core" stylesheet file and by inserting a new stylesheet link tag after this line, any style attribute in "ows.css" file gets overwritten by your customized .css file.

    HOWEVER, you cannot do this in MOSS 2007 and WSS 3.0. By default, there exists no stylesheet link tag for "core.css" in the <HEAD> section of any .aspx file. "Core.css" will be applied automatically at the end of any tag in the <HEAD> section.

    Here I will explain how to edit and apply your custom theme in SharePoint Designer 2007 and this is the easiest way to modify your custom theme.css file.

    1. First create a custom theme; you can refer my other post: http://www.sharepointblogs.com/tigirry/archive/2007/07/03/custom-site-theme-for-sharepoint-2007-moss-2007-and-wss-3-0.aspx

    2. Go to "Site Actions" -> "Site Settings" -> "Site Theme" in your SharePoint site collection and choose your custom theme and apply. Let us assume that the site collection's url is http://mycustomsite.

    3. Now launch SharePoint Designer 2007 and go to "File" -> "Open Site..." and type http://mycustomsite in "Site name" field. Click "Open" to open the site.

    4. In the left side, you should see "Folder List". If you don't see this, press ALT & F1 or go to "View" and select "Folder List".

    5. In the "Folder List", browse to "_themes" folder. You should have a subfolder which is your custom theme folder. Let us assume that the name of the custom theme applied is "CustomBrown" and the subfolder name is "CustomBrown" as well. Editing this subfolder will not change your original theme folder at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown". What you see in the "Folder List" is the copy version of your custom theme folder.

    6. In "CustomBrown" folder, look for the "Cust1011-65001.css" file. This file is created by the site collection when you apply any new theme and it is copied over to overwrite the site collection's "core.css" file. This file does not physically change "core.css" file but this file will be read after the "core.css" file. The format of this file is always "****1011-65001.css" and first 4 characters are always the first four characters of your custom theme name.

    7. Make changes to this "****1011-65001.css" file as needed and you can also add/edit .jpg and .gif files as you make changes to the "****1011-65001.css" file.

    8. When you want to apply and review the custom theme, simple save the .css file and you will see the changes you have made. If you don't see any change, click F5 to refresh or go to "View" and select "Refresh".

    9. After you have finished modifying the .css file, copy its content and replace the content of "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\CustomBrown\theme.css" file with it. You also want to copy and paste any image file you have added or edited to this local folder.

    10. Apply a different site theme to your site and apply the "CustomBrown" theme back to the site. You should see all your changes.

    Hope you enjoy customizing!!

  • IE7 does NOT like InfoPath 2003's "Non-Default Printer"

    Here I am going to describe a bug that I found recently with InfoPath 2003 and Internet Explorer 7 (IE7).

    Here is my scenario: an InfoPath form library exists in a SharePoint site created by SharePoint Portal Server 2003 and the form library has an InfoPath form template. If anyone with Internet Explorer 6 (IE6) opens an InfoPath document in the library and print to a printer that is not the default printer, there is no problem. HOWEVER, if you have Internet Explorer 7 (IE7) installed on your machine and try to print to any non-default printer in InfoPath 2003, the document will automatically be printed to your default printer.

    This bug has been around for a long time but no update or fix has been created by Microsoft. Maybe it will be a different story if you have IE7 and InfoPath 2007. I have not yet tested this with IE7 and InfoPath 2007 but I do not think IE7 and InfoPath 2007 will have any problem. They must be fully compatible since they are tightly connected according to Microsoft.

    There is also a compatibility issue between Microsoft Office Outlook and InfoPath. Outlook 2007 does not like InfoPath 2003 form submission and Outlook 2003 does not like InfoPath 2007 form submission to SharePoint 2003 form libraries. If you are planning to upgrade to Internet Explorer 7 or Windows Vista, you might want to consider purchasing Microsoft Office 2007. Or, if you are going to stick to Microsoft Office 2003, you just have to keep using Internet Explorer 6 and Windows XP :)

  • Custom Site Theme for SharePoint 2007 (MOSS 2007) and WSS 3.0

    The easiest and the fastest way to apply the same look and feel on any SharePoint site is creating a site theme. A SharePoint site theme basically consists of theme.inf, theme.css, and image files. Theme.inf file simply represents the title of the theme. Theme.css is a stylesheet file that defines colors, header images and layouts of a site and image files can be referenced here to display on the page. By creating a custom site theme, you can easily change the style but in fact, writing and editing the stylesheet can be somewhat chanllenging when you have more than a hundred of elements to deal with.

    Here is a short procedure of creating a custom site theme named "Ghost":

    1. Copy any theme folder in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES" folder and paste with its name replaced with "Ghost". In this example, copy GRANITE folder.

    2. In Ghost folder, rename GRANITE.INF file to GHOST.INF in upper case.

    3. Open GHOST.INF file with notepad.

    4. Change the value of title under [Info] to Ghost.

    5. Replace every word, Granite, under [titles] with Ghost.

    6. Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML" file with notepad.

    7. Add the following lines under <SPThemes> tag:
     <Templates>
      <TemplateID>Ghost</TemplateID>
      <DisplayName>Ghost</DisplayName>
      <Description>Ghost theme.</Description>
      <Thumbnail>images/thghost.gif</Thumbnail>
      <Preview>images/thghost.gif</Preview>
     </Templates>
    Notice that preview and thumbnail paths are images/thghost.gif. By default, MOSS 2007 and WSS 3.0 will not have such image files.

    8. In order to display thumbnail and preview correctly, you will need to capture the screen and save the file in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES" folder with thghost.gif name. You can change the .gif file name if you change the thumbnail and preview file names in <Templates> tag.

    9. Do an iisrest for the server to recognize the new theme.

    Pretty simple procedure. Now you are ready to test your new theme. In Site Settings, you can now choose Ghost theme; however, the theme will not differ from Granite theme. Now, it is time for you to play with theme.css file!

  • Custom Site Definition with Custom Master Page for SharePoint Portal Server 2007 (MOSS 2007) and WSS 3.0

    As a SharePoint administrator, if you want to customize your SharePoint sites, the first step is to create a custom site definition with a custom master page.

    In order to create a new site definition, you pretty must have two options: design from scratch or copy and edit the existing template. The former will be more difficult than the latter. Designing your own site definition from scratch can be quite challenging if you are not comfortable with what you are doing. In this exercise, I will explain the "easy" way to do this.

    1. You need to start with copying the existing site template from. On the server computer, browse to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\" folder. Each folder represents a site definition. Copy STS folder and paste with new name. In this exercise, we are going to name this site definition "Business" so rename it BUSINESS.

    2. In this site definition, a custom master page will be used because in the future, you might want to change the master page of thie site definition and not unghost it. To do this, copy "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\default.master" file to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BUSINESS" folder with its name changed to businesscustom.master.

    3. Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BUSINESS\default.aspx" file with notepad. In the first line, change
        MasterPageFile="~masterurl/default.master"
            to
        MasterPageFile="~masterurl/custom.master"
    Doing so will allow the default.aspx file to use the custom master page. Repeat this step for "defaultdws.aspx" file.

    4. Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BUSINESS\xml\ONET.XML" file with notepad.

    5. Add the following line under <ListTemplates> tag:
         <ListTemplate Name=”mplib” DisplayName=”$Resources:MasterPageGallery;” Description=”$Resources:global_onet_mplib_desc;” SetupPath=”global\lists\mplib” Type=”116” BaseType=”1” Path=”GLOBAL” Hidden=”TRUE” HiddenList=”TRUE” NoCrawl=”TRUE” Unique=”TRUE” Catalog=”TRUE” OnQuickLaunch=”FALSE” SecurityBits=”11” AllowDeletion=”FALSE” AllowEveryoneViewItems=”TRUE” Image=”/_layouts/images/itdl.gif” AlwaysIncludeContent=”TRUE” DocumentTemplate=”100” />

    6. Locate the first <Configuration> tag under <Configurations> tag.

    7. Change
        <Configuration ID="0" Name="Default">
            to
        <Configuration ID="0" Name="Default" MasterUrl="_catalogs/masterpage/businesscustom.master">
    Notice that I am assigning businesscustom.master value to MasterUrl.

    8. Locate <Modules> tag under <Configuration ID="0".....> tag and add the following tag under <Modules> tag:
        <Module Name="CustomMasterPage" />

    9. Repeat step 6-9 for <Configuration ID="1".....> and <Configuration ID="2".....> tags.

    10. Locate <Modules> tag after </Configurations> and add the following lines to <Modules> tag:
        <Module Name="CustomMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE">
          <File Url="businesscustom.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
        </Module>
    Notice the file url is the assigned to the custom master page.

    11. So far, we have successfully created a site definition. All we have to do now is to register this definition to the site definition list. To do this, create "WEBTEMPBUSINESS.XML" file in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML" folder. Notice that there exists "WEBTEMP.XML" file in the folder and we are not editing this file. We are creating a new xml file to register a new custom site definition.

    12. Open the file with notepad and insert the following lines:
     <?xml version="1.0" encoding="utf-8"?>
     <!-- _lcid="1033" _version="12.0.4518" _dal="1" -->
     <!-- _LocalBinding -->
     <Templates xmlns:ows="Microsoft SharePoint">
      <Template Name="BUSINESS" ID="5">
         <Configuration ID="0" Title="Business Tools Team Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="A Business site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions." DisplayCategory="Corporation">   
        </Configuration>
         <Configuration ID="1" Title="Business Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/blankprev.png" Description="A blank Business site for you to customize based on your requirements." DisplayCategory="Corporation" AllowGlobalFeatureAssociations="False" >
        </Configuration>
         <Configuration ID="2" Title="Business Document Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/dwsprev.png" Description="A Business site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document." DisplayCategory="Corporation" >
        </Configuration>
      </Template>
     </Templates>
    Notice DisplayCategory="Corporation"; this will create a another tag named Corporation and the three items will be inserted to it. You can change titles, descriptions, and imageUrl's based on your needs. Save and close the notepad.

    13. Last but not least, do an iisreset for the server to recognize the new site definition.

    Comments and feedbacks are welcome. Smile


Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts