Friday, June 29, 2012

A List of List Ideas

A List is one of the most basic features of SharePoint. Think of it like an excel spreadsheet - it contains rows and columns of whatever data you want. You can then sort, filter, or group that data in any number of ways and display it on a webpage. In an environment when you have multiple people editing a webpage, sometimes it is advantageous to store information in a List and give a person access to update that, rather than access to the webpage itself.

Here are a few ideas for information you might want to store in a list:
  • a list of items and how much they cost - SharePoint has the ability to automatically calculate the sum
  • a list of questions and answers - you could include a "category" field and then group the list by category
  • a list of people with their contact information
  • a list of award winners
  • a list of events - SharePoint allows you to create views of the data that allow you to only display the current events

Wednesday, June 27, 2012

I broke the internet

Well, only sort of. Today was not my best day - I rolled out some code that took down our public website for a few hours this morning. The thing is, it only affected FireFox and Chrome (and maybe Safari - didn't check) but IE was fine so I didn't notice right away...when I did notice - I got that sick to my stomach feeling when you know you screwed up but you are not quiet sure how to fix it.
Took about 40 minutes but I was able to fix my mistake and there were several times when I had to wait for something to deploy or wait for a server to reboot. Turns out sitting and thinking about my screw-up made me feel even worse - so to take my mind of SharePoint and code I give you a list of non-SharePoint things that make me happy and do not require me to use any CSS.
  1. Come on, you know you want to: http://www.people.com/people/
  2. My Etsy Shop: http://www.etsy.com/shop/themunch
  3. How a Web Design Goes Straight to Hell: http://theoatmeal.com/comics/design_hell
  4. A great place to get lost in all the cool stuff they sell: http://www.uncommongoods.com/
  5. My favorite mommy blogger: http://www.dooce.com/

Wednesday, June 20, 2012

CQWP Remove Hyperlink

I think SharePoint's Content Query Web Part (CQWP) is one of the most useful tools for an inbetweener. This web part allows you to display information in a variety of ways from a list on your site or (and this is the most useful part) on another site in your site collection. The trouble is, the out of the box styles are okay, but of course I have need for something just a tad different.
The Scenario:
At the college where I work we have a webpage for each program that we offer. Each page has standard information that we display such as name, description, list of courses associated with it. Some of this standard information I have in a list and I want to use the CQWP to display it on the page.
The Problem:
The out-of-the-box CQWP displays a hyperlink to each item in the list. Normally, this is a great feature, but in my case, there is no more data to display - I don't need the hyperlink to further detail, but there is no way to turn it off.
The Solution:
Since the CQWP comes with an array of styles to choose from, I decided to make a new one. I liked the OOTB bulleted list style, so I opened up the ItemStyle.xsl file located in Style Library > XSL Style Sheets and made a copy and tweaked the name, style and removed the hyperlink tags. This is the code I was left with:

<xsl:template name="MyBullets" match="Row[@Style='MyBullets']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title" />
<xsl:with-param name="UrlColumnName" select="'LinkUrl'" />
</xsl:call-template>
</xsl:variable>
<div class="item link-item bullet CQWP_bullet">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate" />
<xsl:if test="$ItemsHaveStreams = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of select="@OnClickForWebRendering" />
</xsl:attribute>
</xsl:if>
<xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
<xsl:attribute name="onclick">
<xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute" />
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$DisplayTitle" />
</div>
</xsl:template>

When you create that new style, it automatically shows up in the CQWP style list and the end user sees this:

Thursday, June 7, 2012

Alternating Row Color of SharePoint List

When modifying the view of a SharePoint list there are several out-of-the-box styles that you can choose from that change the look and feel of how the data is displayed. My favorite one is the Shaded Style which applies an alternating row color to the data.
shaded style

Here is a screen shot of the data on the page - I have information grouped, and when you expand the group you can see the alternating row color. Here is where the inbetweener comes in. I didn't like the out-of-the box color that was applied to the row color, so I changed it using SharePoint Designer.

alternating row color

It's not wise to modify the out-of-the box styles from sharepoint but you can override them by using the following CSS code:

.ms-alternatingstrong {
    background-color: #F2F1EC !important;
}
You should obviously #F2F1EC with your preferred color - although my warm grey is quite nice.

Tuesday, June 5, 2012

Are You an InBetweener?

I'm the webmaster at a technical college which is running SharePoint 2010 on our public website. I work with SharePoint every day and often find that I am an inbetweener - I am more than a Power User but not quite at the level of administrator. I know how things work, but often don't know how to fix them.
This blog will be dedicated to the tips and tricks I've discovered that hopefully most tech savy users (assuming you have the appropriate access) will be able to accomplish. I will strive to explain things in plain english and give step by step guidance whenever I can.