Tip 1: 改了Logo,怎麼還是沒變呢?!
預設提供的“發布門戶”類型的網站中,即使你在網站設定裡,將網站表徵圖換成其他的圖片,但在前台的展示頁面,卻永遠不會顯示你替換的那張,它依然不變!問題是,你在背景管理頁面,居然可以看到它,你換上去的logo。而前台怎麼就不變呢?
下面,我們來找原因。
首先,用Designer開啟網站,開啟前台頁面所引用的主版頁面。
開啟程式碼檢視,找到如下代碼:
可以看到,主版頁面中居然用了AspMenu控制項來顯示logo!!
這就是為什麼,我們在後台換了logo之後,後台能看到換上去的logo,而前台卻沒變的原因。
因為後台所更改的logo地址設定,只會在SharePoint的SiteLogoImage控制項上奏效!如下:
<SharePoint:SiteLogoImage id="onetidHeadbnnr0"LogoImage Url="/_layouts/images/titlegraphic.gif" runat="server"/>
l 下面,有兩個方法可以實現我們的logo顯示。
方法1:
當然就是直接把aspmenu控制項注釋掉,然後加上我們的sitelogoimage控制項啦!
方法2:
按住“Ctrl”,點“logo”的css引用。
簽出band.css檔案後,我們看見代碼如下:
發現,原來已經在css裡面將這一圖片串連給定死了!!!
OK,到此,我們的第二個方法也出來了,修改此串連,讓它導向我們正確的logo圖片。
PS:Service SDK上還附有另一方法
To customize logos used on home pages of SharePoint sites
1. Open the Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES directory.
2. Copy the images that you want to appear on the home pages of your Web sites to this directory.
3. Remove the image files TITLEGRAPHIC.GIF and HOMEPAGE.GIF, which contain the logos used on the left and right sides of the home page, respectively.
4. Rename the new image files TITLEGRAPHIC.GIF and HOMEPAGE.GIF.
All sites now display new logos on their home pages.
Caution: |
The image files that you add may be overwritten when you install updates or service packs for Windows SharePoint Services, or when you upgrade an installation to the next product version. |