Thursday, 7 June 2012

JQuerry & SharePoint 2010 (Part 2)

Following my Previous post, I decided to put the JQuerry library in my Style Library.
Remember: this is not a one off task, as later on you may need to add more scripts in your scripts library.
The next step will be to add a JQuerry reference to your Master Page.It will allow you to use your JQuerry items in every page which is using that Master Page whithout having to reference to it every time. and remember, you only can have 1 JQuerry reference at a time.

By default SharePoint 2010 uses v4.master as sites default and custom master page.
You probably want to create a copy of V4 and add the JQuerry reference in the custom one. When you created your custom master page, open it in SharePoint designer to be able to edit it. Find the file, Right click on it and select "Edit in advanced mode".

Add "ScriptLink" tag as bellow inside the <Head> tag:
<script src="/Style%20Library/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
Save the master page, check in and publish it.

Now go to your site setting, and change the site master page from V4 to your newly created custom master page. and that's it you can start using JQuerry and add your own custom codes. have fun.

In the next post, we are going to add some cool features to this newly build SharePoint site.