Thursday, April 22, 2010

How to make a film strip the default view for a Picture Library

Recently, I was trying to make a picture library for a customer to store their pictures in. I would prefer to use the film strip view as the default view because I think it is nicer looking.

The problem is that the details/filmstrip/thumbnails views are controlled via javascript, they do not change the URL when you visit the page and they cannot be set as the default view.

I found:
which has a pretty good description of how to fix this issue. Only problem is that the most important part, the javascript, is not visible!

I've decided to post it here so that it's easy to find.
<script>SwitchViewStyle('filmstrip');</script >
You'll need to add a content editor to the page, and add this javascript to it.

Make sure you add the content editor web part after the Picture Library View Web part. Otherwise, as the page loads, it runs the javascript before the Picture library exists and does nothing.