Visual Best Bets in SharePoint 2010 without FAST

Using visual best bets is a very simple way to make your best bets stand out, if you don’t have Fast Server setup on your SharePoint environment this is not available out of the box. If you have FAST this is a good article on how to setup visual best bets.  For those of us without FAST here is how I did it.

To show best bests on the search results page you will either need to use a search center or create a custom search page and add the best bets web part to it. Here is what best bets look like out of the box.

SharePoint 2010 Visual Best Bets

Visual Best Bets without FAST

  1. Put the page in edit mode and then edit the best bets web part
  2. Click on the XSL Editor button
    SharePoint Edit XSl Button
  3. You can either or the little editor window or copy the code into an editor like Dreamweaver or Notepad
  4. On line 45 you will see this code
    <xsl:value-of select="Description"/>
  5. We are going to change the code to render the description field as HTML and not just plain text. Change the code on line 45 to this:
    <xsl:value-of disable-output-escaping="yes" select="Description"/>
  6. Save the changes to the web part and save the page.
  7. Now we need to setup our best bets to show images. If you dont already have best bets setup you can follow the steps outlined here
  8. Once you have a best bet setup edit it and in the description use HTML to show the image you want to display.
    <img src="URLofImage" alt="description of image"/>

    SharePoint 2010 search best bets setup

  9. Save the best bet and run a test search.

SharePoint 2010 Search best bets with images and no FAST

Visual best bets not only look better than the other results but can allow you to show more detailed information about the result without them having to click. Using this same solution you could include other HTML to show multiple image, the top pages from a site or other information useful to the person searching.

Read More

A Better Annoucements Ticker

A while back I did a post about how to make a vertical news ticker, in the comments several people pointed out problems with the code so I decided to write a better version of the code. Here it is.

New Ticker

For this ticker I started out with a default Annoucements list. Because I wanted to display a thumbnail for each annoucement I added a signle line of text column called Subtitle and a Picture column called Picture. Here are the columns I used.
List Columns

(more…)

Read More

CSS-Tricks AnythingSlider in SharePoint

Chris Coyier from CSS-Tricks built this really cool jQuery plugin that creates a content slider that will support any regular HTML in the slides. This is cool because many sliders I have used had limitations on what could be on the slides and did not offer many of the featuers the AnythingSlider does.

AnythingSlider in SharePoint
AnythingSlider in SharePoint

Setup

To get this working in SharePoint you will need to make sure you have a reference to jQuery in the page somewhere as well as a list for the slider to read from. For my example I am using an out of the box annoucements list.  You will also need the files for the plugin download the anythingSlider plugin from css-tricks.com.

  • In SharePoint Designer add a dataview webpart to the page with any field from your annoucements list.
  • Switch to code view and find the first <xsl> tag. It should be right after the closing <DatasSources> tag.
  • Right click on the tag and choose “Select Tag”. Press delete, don’t worry we will be adding in our own xsl.

Select the auto generated xsl

  • Paste the following xsl into the page where you deleted the code.

(more…)

Read More

Limitations of displaying attachments in DVWP

attachmentsSo on a recent project I needed to show a link to the attachment for each item in a list. A quick Google search found How to show Attachments with DataFormWebPart from Dario Martirani Paolillo’s Web Log. I was excited because it seemed to work well and was very easy to implement. 

As I was about to finish up the project I was given some new requirements which meant that there would be two Data View Web Parts on the page and both would need to show the attachments link.  This is when the issues started.  When you have two web parts on the page using the display attachments code the second one will just show “[value of field: Attachments]” instead of the actual link.  If anyone knows a good solution for this issue please post a comment.

I want to avoid using something like this jQuery solution by Paul Grenier simply because of the performance issues it will create.

Read More

Dynamic Drive’s Featured Content Slider in Sharepoint

There is an updated version of this solution for SharePoint 2010 found here

I have used Dynamic Drive’s Featured Content Slider on a couple of recent projects and wanted to see if I could get it working in SharePoint. There were several key requirements:

  1. User can easily add items
  2. Users  can choose a style for each item
  3. Expired Items must not show
  4. Each item will have a Title, Body and a customizable “read more” link.

Here’s how I did it.

Dynamic Drive's Featured Content Slider in Sharepoint
Featued content slider

 

The list

First I created a custom list to store the slider items.  These are the columns I used:

  • Title – Single Line of text
  • Body – Multiple Lines of text
  • Link URL – HyperLink
  • Expiration – Date and Time (expired items will not be shown)
  • Image – Picture
  • Style – Choice  (we will use this column to allow users to choose the style of each item)

On the page I used a DataView WebPart to display the Title, Body, Image and Link URL columns.   Using Sharepoint Designer I setup filtering on the expiration date.  To do this in design view right click on the data view webpart and bring up the “Common Data View Tasks ” box and choose Filter.  In the window I set the conditional statement so that items would only be shown if the expiration date was greater than today. (more…)

Read More