One of the better ways of implementing Jquery in your Sharepoint environment

By peter.stilgoe





1. Open up SharePoint Portal and click on Site Actions -> Site Settings -> All Site Settings option

2. Under “Site Administration“group option, Click on “Content and Structure” link

3. From top menu Click “New” List option to create a list of type “Document Library”.

4. Let’s Configure document library further…. Let’s name it as “JavaLib”
[ Note: The name of the document library could be any name you like, I like the name JavaLib as we will use this library to organize all JavaScript’s related resources]

5. (Best Practices) Now, We can configure the JavaLib with additional columns, Versioning and Security so that it can return us a favors like versioning and auto advancing to new versions (if needed).

5.1. Add a column “Script Version” as Single Line of Text to JavaLib

Having “Script version” column becomes very informative when one has lots of developers.

5.2. Configure versioning with 10 Major & 10 Minor Versions

Versioning will allow you to rollback to previous version if there is a bug/known defects without having all other pages needing a modification.

5.3. Set Library security as Read Only to Everyone and Contribute to DevGroup

Limiting who can upload new items (scripts) will help establish controlled processes and release changes using major versions.

6. Let’s download most current JQuery version 1.3.2 from http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js to the desktop

7. Now, Let’s upload jquery.1.3.2.min.js file from our desktop to our JavaLib library.

Note: After uploading the file, Please make sure you change the Name from Jquery-1.3.2.min.js to Jquery and Title as Jquery-1.3.2.min.js and Script version as 1.3.2. This will help us in future if other revisions are available then you do not have to update all webparts with new framework urls.

8. Now we have JQuery available in our environment, with correct control security & versioning in place.

Thanks to Hemendra Patel over @ http://hemsoft.blogspot.com/2009/06/first-look-at-jquery-sharepoint.html

  • Share/Bookmark

Formatting Text / Questions in Sharepoint Surveys

By peter.stilgoe





If you have ever tried to format text and / or insert line breaks into your questions in sharepoint surveys, you’ll know its not an easy task. However by adding some simple javascript you can format the text in your questions as you want.

Basically at the bottom of your survey page add a Content Editor Webpart & insert the follow script:

You will see the script is mapping your HTML standard HTML command to keywords to trigger your formatting.

So say you wanted your question to appear in italics, you would edit your question as normal but insert the italic keyword triggers ie.

How old are you?

To appear in italics you would write the question as:

startitalic How old are you? enditalic

Now your question will appear in italics and so on……..

If you cant edit your survey page to add you CEWP see the previous post on how to edit this page.

  • Share/Bookmark

The Content editor web part and Javascript

By peter.stilgoe





If you didnt know the content editor web part (CEWP) is a great way for adding code ie. JavaScript to your Sharepoint pages without having to edit / change the actual code. You need to add the CEWP to the bottom of your Sharepoint page & add the piece of script. Hey presto, desired effect without editing the actual code, a nice clean & easy way to make mods etc.

A couple of tips if you break your page with some bad code:

If you break your Web page:

When playing with the CEWP, you run the risk of adding bad code that will break your page. SharePoint will then throw out an error message, without offering any way to undo your changes.

If this happens to you, here is a useful trick: append the “?contents=1” querystring to your URL. It will give you access to the maintenance page, where you’ll be able to get rid of the faulty Web part.

For example, if you inadvertently break this page:

http://ThisServer.com/sites/ThisSite/ThisLibrary/allitems.aspx

Enter:

http://ThisServer.com/sites/ThisSite/ThisLibrary/allitems.aspx?contents=1

A trick to edit Web Part pages:

On some pages, the edit option is not available or is grayed out. This is for example the case for the edit form of a list.

The workaround here is to append the “?ToolPaneView=2” querystring to your URL, which will switch your page to edit mode. Note that it seems to be unsupported by Microsoft, though I haven’t read an official confirmation.

For example, if you want to edit:

http://ThisServer.com/sites/ThisSite/Lists/ThisList/editform.aspx

Enter:

http://ThisServer.com/sites/ThisSite/Lists/ThisList/editform.aspx?ToolPaneView=2

Thanks to http://pathtosharepoint.wordpress.com for the above 2 tips

  • Share/Bookmark

Turbo charge your sharepoint lists by using calculated columns to write HTML

By peter.stilgoe

By inluding html in your calculated column formulas you can turbo charge your lists in Sharepoint, see:

Using HTML in calculated columns

Adding traffic light system to Sharepoint lists

  • Share/Bookmark

Sharepoint and JQuery

By peter.stilgoe

If youre not already using JQuery in your Sharepoint environment Im sure you will be in someway in the future, to get you started heres some useful links:

JQuery at EndUserSharepoint

50 JQuery examples

37 more JQuery examples

  • Share/Bookmark

About Me

Sharepoint / MOSS / K2 /Nintex / IA / BI / InfoPath Consultant