In SharePoint 2007 the only lists that offer a comments feature are the posts list in the Blog site template. Wouldn’t it be nice to allow people to post comments on other types of lists like announcements or documents? Well after lots of trial and error I figured out how to do it.
What you will need
Basic knowledge of HTML
I’ll assume you already have a list setup on which you want to allow users to comment. For this example I will use a standard Announcements list.
So the first thing we need to do is create a list to hold our comments. I just used the following columns:
Post (lookup to main list’s ‘Title’ column)
In the main list you will need to add a column that points back to the comments list.
Go to the list settings page and click ‘Create Column’
Name the column ‘Comments‘ (the name does not really matter. Set the type to ‘Lookup‘
The lookup should get information from the comments list you created. The column should be set to the lookup column in the comments list. See the screenshot below. This column will show us the number of comments each item in our list has. (more…)
When users are asked to enter information in a form sometimes it helps to give them a hint regarding what types of information should be entered. Out of the box you can enter a description of each field that will be displayed. If you want something more dynamic here is how to do it.
Add jQuery to the page using the method described in this post
Over the next few weeks I will be writing a series of posts on how to improve the out of the box SharePoint forms by using simple CSS and jQuery solutions. These solutions will help improve usability as well as enhance the look and feel. Look for the first post later this week.
As a point of reference this is what we will be starting with.
Nothing makes a site look good like nice images. Using a large header graphic on you Sharepoint site can help direct users to some important information or announcement. Many non-SharePoint images use this technique to add interest to their site and attract visitors. Doing something like this in SharePoint will make your site a lot less ‘SharePointy’ (my made up word for sites that look like SharePoint). Here is how I did it.
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.
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.
Paste the following xsl into the page where you deleted the code.
This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs.
So one of the things that I have had end users complain to me about is the size of the text boxes on the new and edit forms of lists like the contacts list and announcement list. On a recent non-SharePoint project I used a jQuery plugin to create a resizable text area so I tried to implement it in SharePoint. Here is what happened.
As promised I went ahead and styled the comment form on a standard SharePoint blog. I wanted to make it look better than this but there are some limitations because of the way the page is coded with so many nested tables.
I kept the styles pretty simple but this should be a good starting point for someone wanting to do something more complex. (more…)