Decorate SharePoint HomePage for Christmas

Filed Under (SharePoint, SharePoint branding, css) by Boris Gomiunik on 26-12-2009

How about spicing up company’s intranet for the season? Here’s a neat little trick you can make for adding season’s spirit  to your SharePoint homepage. We’ll add some decoration to page’s head.

image

The first thing you need is the images for the decoration. Don’t make them too big, because you can’t click on anything below images. Below is a simple example I got from Office Online, merged it, removed background and reduced its size. Make sure you have a transparent image (a .GIF or .PNG with transparent background).

christmas

The first step is to upload the image to site’s document or picture library and copy the original image’s URL to clipboard. (don’t copy the SharePoint thumbnail or web preview image, as they tend to get white background instead of original transparent).

image

Next on your homepage add a Content Editor Webpart into any zone and edit its source.

image image

And in the source simply type the following code:

<img src="[your-coppied-image-url]" style="position:absolute; top: 0px; left: 48%; z-index: 99;" />

image

After you click "Save" and "Apply" the page in edit mode will have the decoration in a wrong place.

image

But not to worry, after you exit edit mode, the image will be in the right position. So final result might look something like below:

image

There are numerous variations. You can change the position, you can even use a div with a repeating background image,…

Merry Christmas and a Happy New Year to all SharePoint users and admins!

P.S. If you have any good image (appropriate for transparent background and not violating any copyright rules) for season’s decoration, please drop me a link in this post’s comments.

Oznake ponudnika Technorati: ,,,,,

Highlight weekends in list view

Filed Under (SharePoint, SharePoint branding, jquery) by Boris Gomiunik on 29-08-2009

This trick works with a list view (not calendar view) of any list that has dates. It doesn’t work in a calendar view of a list. We’ll need jquery for this script to work. So if you don’t have jquery uploaded you can download it from jquery.com. The way I usually add it to the site is by creating a document library for “system” files in this demo I’ll create a llibrary called sys.

image  image

When the .js file is uploaded copy its location. Easiest is by right-clicking the document link and selecting “Copy Shortcut”.

image

Now let’s open the list view of the calendar.

image

Now we create an additional column for displaying day of the week. The details are described in this post only using the day name. The formula is

=TEXT([DateField],"ddd")

In the example above in locales where you use decimal comma, use the semicolon as parameters separator.

Next add the created column to the view.

image

Now using the method from this post drag the Content editor webpart to after the list view

 image

Open the webpart’s ToolPane and edit the source code.

image

First insert the uploaded jquery script (which’s shortcut you’ve coppied to Clipboard)

<script type=”text/javascript” src=”http://[site][/web]/sys/jquery-1.3.2.min.js></script>

in the code above replace the src parameter with the url of the uploaded jquery.

Next add the following code:

<script type=”text/javascript”>
$("table.ms-listviewtable tr:contains(‘Sat’) td, table.ms-listviewtable tr:contains(‘Sun’) td, table.ms-listviewtable tr:contains(‘Sat’) td a, table.ms-listviewtable tr:contains(‘Sun’) td a").attr({ style: "color: red;" });
</script>

The code above will color all the texts and all the llinks in weekends in red. The full code is shown in the screenshot below:

image

And the result is:

image

Utility to quickly reapply themes in all subwebs

Filed Under (CodePlex, SharePoint, SharePoint branding, css) by Boris Gomiunik on 11-05-2009

If you’re in SharePoint branding, this small command-line utility might come in handy. If you have a custom template made and deployed to server and after a while you need to make a small modification, you can already be stuck with hundreds of subwebs using your custom template. If you make a change to the existing template, the change won’t be visible in the existing templates until you apply another theme and apply the same theme again to each of those webs.

Because this can be a painstaking job, I’ve composed a simple command-line utility to cycle through all of the webs in a site collection and apply default theme and reapply existing theme.

You can download it from CodePlex.

Usage is simple. Download it to the server running Windows SharePoint Services site you wish to reTheme. Open command prompt in the download folder and run command retheme http://site_collection_url.

ads
ads
ads