Using ASP.NET ServerVariables in a SharePoint Data View Web Part

Quite often I find myself needing to use a server variable in a SharePoint data view web part. These are very useful for getting information that would otherwise not be available to use in a DVWP. There are several resources that explain how to use server variables, so check those out if you haven’t used them before.

Instead of building the server variable parameters using the Common Data View Tasks menu in SharePoint Designer, I find it faster to just type them in when I need to use several of them. With that in mind, I decided to create a quick reference for the most common ASP.NET server variables I use so I can just copy/paste them from this page rather than look them up on MSDN or w3schools.com. There are other server variables, but this is my blog, so I’m only posting the ones most useful to me :). (more…)

Introducing SPTools: A GUI for Performing Batch Tasks on SharePoint Lists

About a year ago I started writing JavaScript functions to perform batch tasks on SharePoint lists using SPServices. I did this because SharePoint didn’t offer the functionality I needed out of the box, and I’m limited to SharePoint Designer for all development at my workplace. After writing several of these functions for one-off projects (mostly site maintenance and cleanup tasks dealing with hundreds of items at a time), I realized that there might be a benefit to creating an easy-to-use toolset for the most common tasks I was performing. (more…)

A CAML Query Quick Reference

I’ve been doing a lot of work with SPServices and SharePoint lists lately, and I find myself using the same CAML queries over and over. Unfortunately I don’t always remember how to format some of the more common queries, so I decided to make a quick reference. There are already some good tools and resources out […]

Create a Crossword Puzzle in SharePoint with jQuery and SPServices

As part of a website redesign communication campaign, I was tasked with developing a web-based crossword puzzle for our intranet site (MOSS 2007). After some brainstorming I came up with a solution that seems to be effective and relatively easy to set up using a custom list to store the answers, some jQuery to enhance the interactivity of the crossword, and SPServices to submit the answers to the list. Check out a demo page of the crossword (it won’t actually submit because it’s just a standalone HTML page and it isn’t on a SharePoint server). (more…)

Deleting Documents with SPServices

A while back I was writing a function using SPServices that would delete a document from a SharePoint library when a user clicked a button. I set up the SPServices function the same way I’d done for other lists, but it wasn’t working. Turns out for documents (as opposed to list items) you must include the FileRef field when selecting what to delete. It took me a while to figure this out because the ID is the only field needed to delete list items.

Here’s an example function that will delete a file from a SharePoint library using jQuery 1.7.1 and SPServices 0.7.1a. You’ll need to call the function by passing in the ID, the FileRef, and the name of the library. Notice the batchCmd variable includes both the ID and FileRef fields:

(more…)

My 2011 Year in Review

This is my first “year in review” style blog post. I feel that this year was particularly eventful for me in terms of my web designer/developer career and my personal life, and I thought it’d be a good idea to reflect on those events and capture it here for myself and any interested readers. (more…)

SharePoint, jQuery, and FullCalendar—Now with SPServices

This entry is part 2 of 2 in the series Building a Better SharePoint Calendar.

In the first entry to this series, I demonstrated how you can use a data view web part (DVWP) to emit SharePoint® calendar events as JSON that the FullCalendar jQuery plugin can use. Although it works fairly well, there are some limitations to the solution. It doesn’t handle recurring events, it doesn’t retrieve all events, it doesn’t support pagination/bookmarking, and it doesn’t provide a way to connect the calendar to Outlook® or create alerts.

This post will overcome the first two limitations by borrowing most of the code posted in this discussion thread on CodePlex and doing away with the DVWP altogether. Jim Bob Howard provided a lot of great information, but it’s broken up over several replies and is a bit difficult to follow. I also wanted to expand on the functionality of his solution by displaying events in the local time zone instead of the web server’s time zone and optimizing the web service calls by retrieving as few events at a time as possible instead of getting a month’s worth of events at a time.

Screenshot of a Fullcalendar demo page.
Fullcalendar in all it’s jQuery-themed glory!

(more…)

A jQuery UI Theme for SharePoint 2007

I’ve been using jQuery UI in a few recent projects on my department’s SharePoint® site. In order to provide a consistent user experience, I used the excellent ThemeRoller to create a custom theme that matched our branding. We have a custom master page, custom page layouts, and our own color scheme, fonts, etc. so I wasn’t trying to match the OOTB look and feel of SharePoint.

However, it recently occurred to me that although I’ve seen a few articles about people using jQuery UI to enhance SharePoint, they usually go with a pre-built theme that doesn’t quite blend with the rest of SharePoint. With that in mind, I decided to see how closely I could match the default SharePoint look and feel using ThemeRoller. I’m limiting this to just SharePoint 2007 for now, although I may do a follow-up for 2010 if enough people find this useful.

What if I don’t like the default look of SharePoint?

First, let me say that although I don’t think SharePoint looks terrible (although many would disagree with me on that!), it does look pretty dated. However, I would rather have a SharePoint site look consistently dated than have a cool-looking, modern tab widget in the middle of a SharePoint page; it would stick out and break the flow of the page design.

There is an argument to this of course—you might want your widget(s) to stick out so that users are drawn to them and don’t lose track of what they’re doing in a complex web application. I recognize the potential value in that. However, if that were the case for me, I’d still want the theme to blend, but I’d probably do something like reverse the primary and accent colors or find a complementary color scheme to use.

Second, I’m not criticizing anyone’s efforts in using jQuery UI without a custom theme. The functionality is the important thing. In fact, I’d encourage anyone using jQuery UI to get things working first and worry about a custom theme as the last step. The great thing about jQuery UI is that it’s set up to be themed by simply swapping out a CSS file and a few images. You won’t need to make any edits to your HTML or JavaScript/jQuery to use a custom theme at a later date (although if you’ve done some additional customization to jQuery UI, you may need to tweak a few things). (more…)