Slinger's Thoughts

February 28, 2008

Microsoft’s Fab40 training site solution, with a few tweaks inspired by Natalya from SharePoint Beagle

Filed under: SharePoint — Tags: — slingeronline @ 10:03 am

Well, I did it.  Sort of.  I liked Natalya’s solution in it’s simple elegance, but it didn’t offer the functionality that the Microsoft solution did.  So I implemented their solution, but I made a few changes to it, that were inspired by the solution that Natalya Voskresenskaya offered.  If she hadn’t posted her solution, I wouldn’t have known what to do or how to do it to make it work.  Permissions were a buggy issue, but that has some workarounds that I threw in that will make it work for us.   I’ll tell you what I did and how I did it.  There was a lot of trial an error, and I would probably like to change one part of it to more closely match Natalya’s solution, but I can change that in the future if need be.  I’ll go over what I did step by step.There are some things that you are going to need to have before you get started though.  First you will need the Microsoft training site template.  This can be found here.  One you have the template installed, go ahead and create a new site based on this template.  You will also need to have SharePoint Designer.  I’m learning more and more that this is a tool that no SharePoint admin should be without.  Once you get the site installed, go ahead and test it out.  Create a test class, and check out all of the functionality.  Signing up for a class, dropping out of one, etc.  You will notice something right off the bat.  If you have users that have only read access, although they can sign up for classes and drop out, when they do, the “seats” value doesn’t change.  If you navigate to the registrations list, (which will be listed under the “View All Site Content” link, you will see that a workflow is having a difficult time.  This is because our students need to have permission to edit the “Courses” list.  So the first thing that I did was to change the permissions setting for the “Visitors” group for the site and added “Add List Items” to their permission level.  Well, this is good and bad.  Now our when our users sign up for or drop out of a class, the seats available in the courses list will change appropriately.  The downside is that now our students have the ability to add, edit or delete courses on a whim.  We don’t necessarily want that.  We will get back to that though.  The next thing that I did was to change who sees what on the default training site page.  Students probably won’t need to see classes they have taught.  I figure our instructors would be part of the “Members” group and our students will be “Visitors” using the default SharePoint groups.  For both of the DataView web parts that are for instructors, I set the audience to be Members.  Now these web parts will only display for users who are part of the members group (which would be our instructors.)  Our students will only see the webparts related to classes they are taking, and not web parts for classes they are teaching, since they technically shouldn’t be teaching anything.  You with me so far?  We haven’t needed to break out our SPD yet, but we will get to that shortly.  While I was setting audiences for the webparts on the main part of the page, it also occurred to me that I should probably set the audiences for the links in the quicklaunch as well.  Our students won’t need the ability to upload files for course materials, etc.  So for all of those links, I set the audience to “Members” as well.  So now I have my site set so that the DataView webparts for “Courses I am attending” and “Courses I have attended” show up for everyone, and the DataView web parts for “Courses I am teaching” and “Courses I have taught” only show up for the trainers.  Now is where I break out my SPD.  I wanted to create another DataView web part that would integrate with this site and work like the main DataView web part from Natalya’s site.  I couldn’t get it to work exactly like that, but I did get it to work well enough.  Open up the default.aspx file in SPD and then insert a Dataview Web part above all of the other web parts on the page.  When prompted for the list to attach this to, select “Courses.”  I chose the same columns that are listed on the other dataview web parts so that my site looks consistent. (Course Title, Location, Start and End Time.)  I set the title for this Webpart to “Upcoming Courses.”  I wanted to have a Form Action button like Natalya’s solution, but I couldn’t figure out how to get it to work in this site the same way that it did in her solution.  I decided that instead I would link the title of the course in the same way that the other web parts did.  In the dataview web part, click on a course name under the “Course Title” column.  In the fly out that appears, under “Format as” select “Hyperlink.”  Then click on the link in the fly out labelled “Hyperlink options.”  Click “yes” on the warning box.  We have a few formulaic things to set here.  First, set the “Address” field. Click on “Lists” in the center navigation window, then “Courses” and then “DispForm.aspx”  This will send a user to information about the class when they click on the title.  We need to tell it which class though.  Click on the “Parameters” button.  The top window should show a path.  We need to add a query string though.  Go ahead and click “Add.”  In the “Add Parameter” dialog, under “Name” click the drop-down box and select “XSL: ID.”  The “Value” should automatically set to {@ID}. Go ahead and okay out of the dialogs.  When you get back to the “Edit Hyperlink” dialog, you’ll notice that the “Address” field now has the properly formatted string to select the correct class.  If you look at the “Text to Display” field near the top though, it shows the same thing.  We’ll want to change that.  Click on the fx button and then select “Course Title.”  Now the Text to Display dialog should be {@Title} and the Address should be Lists/Courses/DispForm.aspx?ID={@ID}  You probably could enter all of this manually, but if you wanted to display some other information, or link different information, now you have an idea of where to go to make sure that your code is formatted correctly. (It took me a while to get it right.) Now our DataView web part will show all of the classes that we have scheduled, and has a link to the registration page for each class.  (I could probably have set the form action button here, but I was happy with what I had worked out so far.)  I have an issue now though.  This web part will show all of the classes that are, or were scheduled, even if they were 3 weeks ago.  I only want it to show “Upcoming Classes.”  I’ll need to set a filter on what is displayed.  I open the “Common Data View Tasks” pane, (the fly out arrow at the right of the DataView web part) and click on “Filter.”  In the Filter Criteria window, I click on the first line to add a new clause.  For “field name” I select “Start Time.” For “comparison,” I choose “greater than,” and for “Value” I select [Current Date].  Now this webpart will only show classes where the start time is after the current time and date.  One of the nice things about the other webparts on the page is that if there is nothing to display, they show some text that gives you an idea of what to do next.  I wanted my “Upcoming Courses” web part to do the same.  In the “Common Data View Tasks” fly out, click on “Data View Properties.”  In the first tab, I clicked the checkbox to “Enable sorting and filtering on column headers” so that you can sort and filter the view like you would in any document library, and near the bottom I checked “Display test if no matching items are found.”  If nothing in the courses list meets the filter criteria, this is the text that will get displayed instead.  Much thanks to Natalya for her insight into the data view web part and introducing it to me.  I will likely use the hell out of it from now on. 

Well I could say that I was finished at this point, and I could stop.  Everything works exactly as it should, and I’ve added some more useful functionality to the default site.  (If you have installed this template, do yourself the favor of fixing the workflow in it for unregistering from a class.  Instructions for this are here.)  The only thing I wanted to do was to remove any obvious ways for our users to alter any of the class information.  Every time that you clicked on the link to a scheduled course it brought you to a page with a description about it, and a button to register.  I opened the page in SPD, located at /Lists/Courses/DispForm.aspx, and tried to find out where the tool bar was located for the information across the top of the webpart.  The only thing I wanted users to do from this page was to register or unregister from a class.  Our instructors can manage the class from a link I added to the quicklaunch, and set the audience for.  The first thing was to find out where that tool bar resides.  One of the things that shows up on the page is information about who created the class and who the last person to modify the class was.  This information doesn’t have a real purpose, so I deleted the table area that contained the ModifiedCreatedBy control.  Just above that is another SharePoint control toolbar, and when I deleted that, the tool bar for editing list items didn’t display any more.  I was happy with that result, although, in retrospect, I probably should have added a security setting instead of deleting the menu.  In any case, always make a back up of a file that you are working on. 

So there you have it in a nutshell.  I know this isn’t the best description of how I made the changes, and screen shots would be a great help.  If I ever get some decent screen shot software I will add screenshots to help explain what I did better.  If anyone has any questions, let me know in the comments.  Microsoft did a good job with the “Fab 40,” but they didn’t quite put the polish on these templates that they needed to.  Just like anything else in SharPoint, out of the box is okay, but if you really want to make it work for your organization, chances are you are going to need to make some modifications. 

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: