Does your email need a sidebar?

I created this simple flowchart for a few colleagues at work to help determine if their email communications could be a single column or if it should have a two-column layout with a main column and a sidebar that has additional information. It’s a grossly oversimplified way to make that kind of decision, but we are dealing with internal company email newsletters and announcements going to a few hundred employees, so we’re not exactly running a huge marketing campaign.

The general idea is that text-heavy emails that have a call-to-action should put the call-to-action in a sidebar where it’s easy to see and get readers’ attention instead of burying it in the text of the email (which tends to happen a lot).

Email sidebar flowchart

Does your email need a sidebar?

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 :) . Continue reading

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. Continue reading

Deleting SharePoint Sites is Fun

This afternoon I performed an audit of several SharePoint team sites. Over half of them had not been touched in a year or more. Some of them were just an empty team site that had never been used.

I deleted them.

Don’t build a SharePoint site if it isn’t actually needed.

Screenshot of SharePoint website deleted

You can almost hear the content database sigh with relief.

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 there for building CAML queries. U2U’s CAML Query Builder is usually what I fall back to when I need a complex query with multiple conditions. Matt Bramer’s roboCAML is shaping up very nicely as well. However, in many cases these are overkill and I just need a basic “get all items where field X is equal to value Y” query. Heck, sometimes I just want to hard-code the query myself because it’s good practice. A quick reference that shows what value type to use and in what format for the various field types is all I really need so I don’t have to hunt through several bookmarked articles to find the answer.

I intend to update this on occasion, so if you have any suggestions please leave them in the comments. Continue reading

Share One iTunes Library on Multiple PCs Over a Network

A few years ago I built a PC to function as a semi-dedicated file server. It’s running Windows 7, so it’s still a fully-functional PC, but it’s not my primary workstation. Among other things, I use it to store all of my music, photos, videos, and documents in a central location that is backed up regularly. My primary desktop, my HTPC, and my laptop can access all of these files over the network via a Windows Homegroup.

Until recently the only copy of iTunes I used was on the server PC to sync my iPod classic. On my primary desktop I preferred to use MediaMonkey for music playback because of its speed and excellent library organization features. The only downside was that my play counts and ratings in MediaMonkey didn’t sync with my iTunes library on the server. It was a limitation I’d been content to live with up to this point. Continue reading

From Request to Testing to Deployment in 24 Minutes: That is the Power of SharePoint

This afternoon one of our managers in my department stopped by my desk with a simple request. She wanted to be notified when a new list item was created on a custom list I had built for her about a year ago. She had set up a twice-weekly reminder in Outlook to check the list so she could process new items, but she tended to dismiss the reminders and the list would go unchecked for several weeks.

This is where I think a lot of people tend to go wrong when it comes to requests like this. My sole responsibility is to develop process and technology (mostly web-based) solutions for my department (i.e. I’m not in the IT department and my salary comes out of my department’s budget, not IT’s). At this point we could have made a big fuss over-analyzing the process and finding a better way for her to check the status of the list, or I could have dismissed her request on the grounds that an Outlook reminder should be sufficient (and I wouldn’t necessarily have been wrong to suggest that). I could have even shown her how to create an alert herself (or created one for her) that would have notified her of new items.

However, this wasn’t a high-volume list, so spending any amount of time to find ways to improve the process wouldn’t have really paid off in the long run. Telling her to just use Outlook would have been a dick move (and I try not to be a dick). And the emails for OOTB alerts confuse me, let alone end-users.

Instead I simply dropped what I was doing and said “I can do that.” Just for fun I asked her to time me. Then I created a custom workflow in SharePoint Designer that emailed her an easy-to read message with a clear and concise subject line, a brief message stating a new item had been created, a link to the item, and a link to the default list view, all formatted nicely using a branded HTML email template that I have on hand for such occasions.

That took 11 minutes.

I initiated the workflow manually on an existing item. Several minutes later she sent me some feedback stating that she would never need the link to the item itself. She also preferred a link to a filtered view that we had already created when the list was built. I removed the link to the item in the email message and replaced the default list view link with a link to the filtered view and sent another test. Less than a minute later she responded and said it looked perfect.

She had a working solution within 24 minutes of asking for it. I built the workflow right on our production intranet site on the actual list and used live data to test it (gasp!). Nobody submitted a project request form. No formal requirements gathering took place. No servers crashed. I was able to build the solution in less time than it would probably take to fill out a freaking project request form. That is the power of SharePoint.

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). Continue reading

A CSS Naked Day WordPress Plugin

CSS Naked Day is tomorrow, April 9th. Being an advocate of web standards, I think this is a very cool (albeit not well-known) event. You can read more about it at http://naked.threepixeldrift.com/.

I wanted to participate this year, but the only WordPress plugin for CSS Naked Day I could find was several years out-of-date (and therefore wasn’t fully compatible with the latest version of WordPress and used some WordPress coding practices that are no longer encouraged). Therefore I decided to create an updated plugin with a few more options based on that work.

Using the Plugin

  1. Download my JAM CSS Naked Day plugin. You can then unzip the files and add them to your WordPress plugins folder (wp-plugins/JAMCSSNakedDay/) or use WordPress’ built-in plugin installer to upload the zip file.
    Screenshot of plugin upload page

    You can upload the zip file to install the plugin using WordPress' built-in uploader.

  2. Once the plugin is activated, you’ll see a CSS Naked Day page under the Appearance menu.
    Screenshot of CSS Naked Day menu item

    A CSS Naked Day menu item will be added to the appearance menu.

  3. You can specify a few options for the plugin, including a preview options that lets you (or any logged in administrator) view your site without CSS.
    Screenshot of CSS Naked Day options page

    You can set several options for the plugin to suit your preferences.

Options

Preview Mode

By checking this box the plugin will be active for any logged in administrators, regardless of the date. You can use this option to test how your website will look on CSS Naked Day. I think this is also a good method for checking your theme  to see if it uses standards-based, semantic markup.

Timeframe

CSS Naked Day takes place on April 9th, but depending on your time zone that day actually covers a 48 hour block of time around the globe. You can choose to only remove CSS for your website’s local time zone or for the full 48 hours so that all time zones will see your naked website for at least the entire day.

Script Mode

The plugin that I initially found used PHP output buffering to strip style sheets from the HTML output before the server rendered the pages. I realize that this may introduce some performance issues and potential conflicts with caching plugins, so I also provide a JavaScript option (using jQuery) that removes style sheets and inline styles once the page is loaded.

Display Message and Message Text

You can choose to display a message explaining why your website is naked. This reassures your visitors that there is nothing wrong with the website, and it can also provide information about CSS Naked Day. The plugin uses JavaScript (via jQuery) to prepend the message to the website’s <body>.

Compatibility and Feedback

The plugin has been tested in WordPress 3.3.1. It uses the latest best-practices for the WordPress settings API and security. JavaScript is properly enqueued using wp_enqueue_script, and plugin options are passed to the script via wp_localize_script to avoid writing .js files with PHP. The plugin also includes an uninstall.php file that will remove all settings it created in your website’s database if you decide to uninstall it.

As with the plugin this is based on, there is a known issue when using PHP output buffering in which occurrences of inline styles (style="") that are intended as text and not as an HTML attribute will also be removed (e.g. in CSS tutorial pages and other code snippets). You can avoid this by using JavaScript mode. Please let me know if you have any suggestions or encounter any other issues.

SimpleMaxChars Plugin for jQuery

My SimpleMaxChars jQuery plugin adds a message displaying the number of characters remaining in an <input> or <textarea>. I needed a fairly basic solution quickly and most of the existing plugins that offer similar functionality were too big, too small, buggy, or didn’t meet my specific needs. If this looks like it will work for you, feel free to use it! Continue reading