Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Monday, 16 July 2007

Editing SharePoint Themes

As I mentioned a few days ago I've been working on CSS files to edit themes in SharePoint. I haven't seen much documentation on how to do this so after picking up pieces from different places and then figuring out what to do I thought I'd pass my knowledge on.

I have access to SharePoint, SharePoint Designer and IE Developer Toolbar. I find SharePoint Designer better for viewing CSS or HTML files, but another good programme is Notebook++ which is an open source, source code editor for use on Windows. It supports many different languages:

ASP, Ada, ASCII art, Assembly, AutoIt, BAT, C, C#, C++, Caml, CSS, doxygen, FORTRAN, HTML, Haskell, Java, JavaScript, KiXtart, Lisp, Lua, makefile, Matlab, Objective-C, Pascal, Perl, PHP, PostScript, Python, Ruby, Scheme, Unix Shell Script, Smalltalk, SQL, Tcl, TeX, Verilog, VHDL, VB/VBScript, XML

You can download Notebook++ free here

Anyway getting back to the subject editing themes. To edit the theme you need to open the theme file. This is located in /_themes/THEME_NAME/THEME_1011-65001.CSS replacing THEME_NAME and THEME with the name of the theme you wish to edit. Open it from the SharePoint site. Doing that should open the CSS file in your default code editor, unless you have SharePoint Designer then you can locate it that way.

So now I have the CSS file open, I have my Web browser open with the site and theme I want to edit and IE Developer Toolbar. First thing to do is on the IE Developer Toolbar click on "Find" and then on "Select Element By Click" this means that you can click anywhere on the web page and you will not be taken to another page and it will show you the attributes for that part of the page that you have clicked on. So for example, I want to change the page border colour. So I clicked on the page border and in the current style list navigate to the background-color attribute, then right click on this and click "trace style" this brings up a new window, showing me the following

.ms-main {
BORDER-RIGHT: #ffffff 15px solid;
PADDING-RIGHT: 5px;
BORDER-TOP: #ffffff 15px solid;
PADDING-LEFT: 5px;
PADDING-BOTTOM: 5px;
BORDER-LEFT: #ffffff 15px solid;
PADDING-TOP: 5px;
BORDER-BOTTOM: #055baa 15px solid;
BACKGROUND-COLOR: #e3efff

Then a quick CTRL+F in SharePoint Designer and search for .ms-main will take me to the part of the .CSS file I wish to edit (a good idea is to either write in a comment detailing your changes or to create a copy in case you need to go back to the original.)

So I then changed all the #ffffff to blue wrote in a comment to say it was originally white and the I saved the file. After doing this the theme was just how we needed it so I had a look at another theme to see if any others could be edited slightly to become useful. On going back to my edited theme I noticed that everything I had changed had gone back to how it was. I still had SharePoint Designer open so I re saved the file and refreshed the browser, it changed again to the edits that I had made, so I realised that there must be another file that needs editing too in order to keep the theme the same. I discovered this file in the 12 folder on the server. This folder can usually be located in \Program Files\Common Files\Microsoft Shared\web server extensions\12 then navigate to "Template" and "Themes" there you will get a list of all the available themes, navigate to the one that requires editing. In my case my theme is called "Blue" so I opened the "Blue" folder, in this folder you will see 5 .CSS files, these should be called:

  1. COLOR0.CSS

  2. COLOR1.CSS

  3. GRAPH0.CSS

  4. GRAPH1.CSS

  5. THEME.CSS


The THEME.CSS is the flie that needs to be edited in order to save the changes, this file begins with the body tag and looks something like this:

body {
font-family:Arial;
background-color:#FFF
text-align:center;
margin:5px;
}

This is the first line in the THEME.CSS however it is not the first line in 1011-65001.css, you will find this at approximately line 150. So now it is just a simple case of copying everything from body downwards, emptying the THEME.CSS file and pasting what you have copied into it. Once this is saved you can change your theme and go back to it and your changes will still be there. I did not require an IIS RESET to do this but there is a chance your changes won't save without one.

If you have any questions on this subject post me a comment and I'll do what I can to help :)



I have a confession to make - contrary to what I previously said the 1011-65001.css file is only acessible with Frontpage or SharePoint Designer, sorry about the mix up!


Free Blog Counter


Thursday, 12 July 2007

200 Posts - Overview Part Deux!

As I said in my last overview I monitor my site activity with http://blogcounter.com

I've reached the 200 views mark today so I thought I'd do another review.

The page with the most views is still The Church of Gaming but a close second is the Sol article

The most searched words that links people to my blog are "madeleine update" and "maddy, blogspot" As of yet google has been used 52 times. The other 148 views seem to of come from a combination of Digg and Reddit and a few people have visited from when a post of mine was posted on the Mirror Forums

The most popular OS was still Windows XP with 65.7% (134 people) using it to view my blog, as of yet not one person has viewed my blog using Microsoft Vista, I wonder if this says something? Is Vista not as popular as MS are claiming, but thats for another post ;-) The second most popular OS is no longer Linux, now it is WinNT6.0 with 8.3 %, Linux and Windows 2000 are tied for third place with 5.9 %

The most popular browser is no longer Firefox last time Firefox had 62% this time Firefox only has 44.1 % and Internet Explorer takes the lead with 52 % Netscape was third with 2.5 %

So I wonder how much will change by my next review? I'm not sure whether to review again at 300 because it might come too soon, maybe a third review at 500 would be better.



Free Blog Counter


Internet Explorer Developer Toolbar

I've recently started using the IE Developer Toolbar after discovering it thanks to Shane Perran's SharePoint Blog It is a very useful addon for Internet Explorer especially as in work I can't have Firefox, and as I'm working with a SharePoint site on the server that isn't FF compatible. The toolbar downloadable here is a useful tool for exploring the HTML or CSS on a webpage.

The Microsoft overview:
Overview

The Internet Explorer Developer Toolbar provides several features for exploring and understanding Web pages. These features enable you to:

* Explore and modify the document object model (DOM) of a Web page.
* Locate and select specific elements on a Web page through a variety of techniques.
* Selectively disable Internet Explorer settings.
* View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
* Outline tables, table cells, images, or selected tags.
* Validate HTML, CSS, WAI, and RSS web feed links.
* Display image dimensions, file sizes, path information, and alternate (ALT) text.
* Immediately resize the browser window to a new resolution.
* Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
* Display a fully featured design ruler to help accurately align and measure objects on your pages.
* Find the style rules used to set specific style values on an element.
* View the formatted and syntax colored source of HTML and CSS.

The Developer Toolbar can be pinned to the Internet Explorer browser window or floated separately.

I am at the moment using it to edit the CSS files for a SharePoint theme, and it is making my job a whole lot easier!



Free Blog Counter