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.

9 comments:

Unknown said...

Worked great! Thank you!

cory church said...

perfect. just what I needed. thanks

Vin T said...
This comment has been removed by the author.
radhe said...

Hi I cant get the output for this please anyone of you help me.

Tom Molskow said...

I think the contents of the link you provided has changed because it's no longer anything about the picture view.

Jeff Lester said...

Yup, looks like that link is dead. It doesn't matter, you don't need it. I just wanted to put it there to give that person some credit for pointing me in the right direction. I believe that javascript is a sharepoint function. Just put it in a content editor.

Jeff Lester said...

It's not needed, I just wanted to give him credit for pointing me in the right direction.

Proximus said...

nice solution! Thx.

Anonymous said...

Use StripView control to create strip