Nothing But Branding for SharePoint Beginners


You may also be interested in: Documentation Toolkit for SharePoint by Acceleratio Ltd.


 

If you haven’t noticed, over the past month or two we’ve added authors who are writing beginner tutorials on all aspects of SharePoint branding: CSS, master pages, themes and best practices. We get requests all the time for beginner articles, so I hope these are helping fill the bill and you are finding them useful.

I thought it would be nice if we started to aggregate all the titles in one place so you can have an index as these articles continue to grow in number. Check them out, choose your titles and dig a little deeper. There’s no better way to become a SharePoint Power User.

Benjamin Niaulin, Maxime Soucy, Marc-André Bilodeau Lamontagne, Christian Merat

Benjamin Niaulin MaximeSoucy.png MarcAndreBilodeauLamontagne.png ChristianMerat.png

Articles on CSS by Benjamin Niaulin

Articles on jQuery by Maxime Soucy

Articles on Master Pages by Marc-André Bilodeau Lamontagne

Articles on Best Practices for SharePoint Branding by Christian Merat

Upload Images Directly from a List Input Form in SharePoint 2010


You may also be interested in: SharePoint-based solutions by B&R Business Solutions


 

Editor’s note: Contributor Tom O’Connor is a SharePoint consultant for Loftus IT. Follow him @heatus

Problem

Normally on lists and libraries to add a picture you would use a ‘Hyperlink or Picture’ column. That’s all fine and good if you know the URL for the image. Unfortunately though, this column provides no way to upload or select items already sitting in SharePoint. While searching around for a solution to this problem I found that there were a range of different ways people have achieved this including the creation of new field types and custom aspx upload pages.

I knew that this had to be complicating things, after all you see image upload/selection functionality elsewhere in SharePoint 2010 (Rich Text Editor!).

Solution

There is, in fact, a column type already in SharePoint called “Publishing Image” which appears to be used in the Page Content Types and their associated Page Layouts. The good thing about this column is that it allows you to select from existing content in SharePoint. It also allows you to specify various attributes relating to the image such as Alt text, width and height.

Well, that solves half of the problem. Thankfully Arnault Nouvel has created a CodePlex project called ‘SharePoint 2010 Image Field Upload’ which does the rest. It is basically some jQuery that gets around this upload problem. If you add the javascript to your masterpage it finds any references where the Image Asset picker is used and adds an additional link that invokes the out of the box Rich Text Editor Upload Control. To me this is awesome because it is not actually using any custom controls.

I had to make a slight amendment to Arnault’s javascript so that the hyperlink the jQuery was creating included target=”_self”. I found using the original code that the upload link within modal dialogs would launch a new window rather than remaining on the same page. I have linked the *slightly* modified JS file at the bottom of the post.

Demonstration

I will now run through an example to add this Image field type to an Annoucements list.

  1. Create a new Site Column called and set the type to “Image with formatting and constraints for publishing
  2.  

    2012-05-29-UploadingImages-01.png
     

     

  3. Add the new site column to your announcements list. Prior to adding the custom javascript you will notice the input form will appear as shown below.
  4.  

    2012-05-29-UploadingImages-02.png
     

     

  5. Add a reference to the custom javascript in the masterpage (also make sure that you have jQuery referenced in there too). Now when you add an item to the list the field will have an additional link to insert a picture from your computer.
  6.  

    2012-05-29-UploadingImages-03.png
     

     

    Clicking this will show the normal upload picture dialog:

     

    2012-05-29-UploadingImages-04.png
     

     

  7. After selecting an image and uploading it, it will be added to the item and it will actually display when you view the item details.
  8.  

    2012-05-29-UploadingImages-05.png
     

     

    This also works in views for the list:

     

    2012-05-29-UploadingImages-06.png
     

     

Hope this post is of use to some people, let me know in the comments how you applied this. Big thanks to Arnault Nouvel for putting together the CodePlex project and doing pretty much all the hard work!

Download: SPImageFileUpload.js (19)
Original CodePlex Project: http://spimagefieldupload.codeplex.com/

SharePoint: Get Started with jQuery – Part 4: Instant List Filtering


You may also be interested in: SharePoint Hosting by Fpweb.net


 

Editor’s note: Contributor Maxime Soucy is a .NET Agile developer at GSoft Group. Follow him @maxsoucy

Filter as you type with jQuery

We’ve used Javascript and jQuery to modify the look of the Quick Launch menu in a previous article. Now let’s see if we can modify another simple element of the SharePoint environment, a link list. Since lists can quickly become unmanageable when they begin to grow in size, let’s see if we can use jQuery to quickly filter a list. SharePoint already has web parts available for filtering but I’m sure we can easily make something more useable. We should be able to filter by all the columns at the same time and we want the filter after each keystroke in our filter input.

  1. Let’s create a simple link list called “TestLinkList”. I have added a number of websites that we want to be able to filter by. Here is a screenshot of the list inside of a page. We can see at the bottom, we’ve added an HTML input using the HTML. (<input type=”text” id=”filterInput”></input>)
  2. 2012-05-30-GetStartedWithJQuery-Part04-01.png

  3. We can assume that we already have access to jQuery on our page. We have looked at a number of ways to do so in part 2 and part 3 of my past articles. I created a script called “listfilter.js” and referenced in the page using the same method.

  4. $(document).ready(function() {
    	//Insert step 3-4 here!
    });
    

  5. The script itself is simple. In our document.ready function, we start with declaring a couple of Javascript variables that will hold the jQuery selectors for the various elements we are going to reference. The list, the elements of our list and the input where we will type the filtered word.

  6. // Table of my link list. Obviously we reference the class and not the id. 
    var list = $("table.ms-listviewtable");
    // Table row of the items in my list.
    var listItems = $("table.ms-listviewtable tr:not(.ms-viewheadertr)");
    // Our filter input.
    var input = $("input#filterInput");
    

  7. Then we need write code that will compare the text data in our list with the filter. Read the comments in the code to understand what each line does.

  8. input.keyup(function() // On key presses
    {
        listItems.each(function() // for each items in our list
        {
    	var text = $(this).text().toLowerCase(); // get all the text values of that list item
    	if (text.indexOf(input.val()) != -1) // does it match the text of our filter?
    { 
    	     $(this).show();// yes! show it!
    	}
    	else
    {
    	     $(this).hide(); // nope! hide it!
    	}
        });
    });
    

We are now able to see the fruit of our labor! A nice and simple filter of the elements of our list. To use our filter, simply type in the text box.

2012-05-30-GetStartedWithJQuery-Part04-02.png

After we become more adept working with jQuery and SharePoint, we can move all our code into a feature that is more maintainable than a script inserted into a content editor web part. SharePoint tends to add elements into the HTML source after you save.

Pros:

  • Instant and effective search of all the columns in a list. We harness the quickness of jQuery’s DOM search capabilities.
  • After we go a bit deeper into jQuery, we could customize our filter tool a bit more like being able to filter only certain columns
  • All the filtering is done by the browser. We don’t need to refresh the page or query SharePoint for search results.
  • Our filter will work with all the lists that use the class “.ms-listviewtable” on our page. For example, add a task list to the page and and see that our filter works nicely on both lists!

Cons:

  • We can filter only by the shown list items. This will not work if the list has paging.

Brand SharePoint: Quicklaunch – Menu links Backgrounds


You may also be interested in: O’Reilly – SharePoint 2010 at Work


 

Editor’s note: Contributor Benjamin Niaulin is a SharePoint Specialist at Groupe GSoft Inc. Follow him @bniaulin

We have learned to use the CSS Chart and the F12 trick combined with our basic CSS learning dating back to the first articles in the series (see the bottom of this article for navigation). Today I want to show you something new. In the last article covering the QuickLaunch, I looked at the two classes that modify the Headings and the Links in the QuickLaunch menu.


.s4-ql UL.root > LI > .menu-item

And


.s4-ql UL.root UL > LI > a

The first for headings and the second for links.

This time I want to apply backgrounds

Sounds like a simple task, I already have the two elements separated above. So I searched the net, looking for the best way to work with backgrounds on menus. I didn’t save any links, but something kept coming back over and over. They called them “CSS Sprites”. Yeah, I had the same reaction, but I decided to figure it out myself. Went to my favorite site to learn more about CSS and found this:

- “An image sprite is a collection of images put into a single image.
A web page with many images can take a long time to load and generates multiple server requests.
Using image sprites will reduce the number of server requests and save bandwidth.”

The idea is for me to put in the same image, the regular menu background and the hover effect. If there are two different images, then when people put their mouse over the hover image it might take a while to load since no one has visited yet. With CSS image sprite, the image was already loaded with the hover effect when the page loaded, cool!

Creating my own CSS Image Sprite

Right, I opened Photoshop… the monster. Yes I do get scared of it sometimes, it’s definitely not a power user tool. I would like to mention that Photoshop is not required to do CSS sprites, all you need is two images in the same image. You also need to know exactly where they are in the image. I read two short articles:

I was able to make this somehow

2012-05-30-QuickLaunch-Part04-01.png

In the same image, I put the background of regular links and the background of selected and hovered items. Very important, I took down the position where each is placed in this image. The darker blue is at -10px from the top and the lighter blue is -50px from the top. Each of them is also 30px high.

2012-05-30-QuickLaunch-Part04-02.png

You can download the images here or contact me @bniaulin to get them.

Applying it to SharePoint

Let’s update our Content Editor Web Part using the HTML Editor to add our CSS. I started by adding the classes we analyzed in the previous article and mentioned above. I then added the image, I created, and uploaded to SharePoint. Here is the code (If you are not sure what this code means, refer to previous articles in the series by using the navigation at the bottom):


<style>
.s4-ql UL.root > LI > .menu-item {
BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px; min-height:30px;
}
.s4-ql UL.root UL > LI > A {
BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px; min-height:30px;
}</style>

I used the minimum height of 30px because that is the height of the image.

Result:

2012-05-30-QuickLaunch-Part04-03.png

Looks like we might still have some work to do. First thing I want to do is remove the humongous space left between each headings menus.


.s4-ql UL.root UL {
	MARGIN-BOTTOM: 0px
}

This says that every UL (Unordered Lists) inside the UL which uses the .root class inside a container which uses the .s4-ql class will have its margin-bottom reduced to 0px.

2012-05-30-QuickLaunch-Part04-04.png

Looks like SharePoint still has some space between each item, using my F12 trick I found out that both Headings and Links have padding top and bottom. I need to remove it.


.s4-ql UL.root > LI > .menu-item {
	BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px;min-height:30px; padding-top:1px;padding-bottom:1px;
}


.s4-ql UL.root UL > LI > A {
	BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px;min-height:30px;padding-top:1px;padding-bottom:1px;
}

2012-05-30-QuickLaunch-Part04-05.png

Adding hover and selected effects is next on the menu. This step is a simple copy and paste of the CSS Classes we used for headings and links and adding the :hover CSS pseudo at the end. For selected links, we learned from past experience that SharePoint uses the .selected class. Add the following to your Content Editor Web Part HTML Source Editor.


.s4-ql UL.root > LI > .menu-item:hover {
BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -50px;text-decoration:none;
}


.s4-ql UL.root UL > LI > A:hover {
BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -50px;text-decoration:none;
}


.s4-ql UL.root UL > LI > A.selected {
BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -50px;text-decoration:none;
}

Here is our hover effect without losing performance because we are using CSS Sprites.

2012-05-30-QuickLaunch-Part04-06.png

All that’s left is to adjust the text of the links written inside. Remember, there are two kinds of links, Headings and Links. There is a class used by both: .menu-vertical .menu-item-text

This means all items using the .menu-item-text class that are under a container that uses .menu-vertical css class. However, the font size of Headings uses the class first mentioned in this article. And because that class is more specific to headings, it wins over anything we will specify in .menu-item-text.

I will have to update .s4-ql UL.root > LI > .menu-item to add the same font-size I will specify in .menu-vertical .menu-item-text

Updated .s4-ql UL.root > LI > .menu-item


.s4-ql UL.root > LI > .menu-item {
	BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px;min-height:30px; padding-top:1px;padding-bottom:1px;font-size:1em;
}

Added .menu-vertical .menu-item-text at the end of the CSS


.menu-vertical .menu-item-text {
	TEXT-TRANSFORM: uppercase; COLOR: white; FONT-SIZE: 1em; FONT-WEIGHT: bold; PADDING-TOP: 5px
}

2012-05-30-QuickLaunch-Part04-07.png

Fine-tuning the menu

Now all we have to do is play with the menu to give it a real feel. I went to the Site Actions menu, Site Settings and changed the QuickLaunch Navigation items to get the following result.

2012-05-30-QuickLaunch-Part04-08.png

Complete CSS in my Content Editor:


<style>
.s4-ql UL.root UL {
	MARGIN-BOTTOM: 0px
}
.s4-ql UL.root > LI > .menu-item {
	PADDING-BOTTOM: 1px; MIN-HEIGHT: 30px; BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px; FONT-SIZE: 1em; PADDING-TOP: 1px
}
.s4-ql UL.root UL > LI > A {
	PADDING-BOTTOM: 1px; MIN-HEIGHT: 30px; BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -10px; PADDING-TOP: 1px
}
.s4-ql UL.root > LI > .menu-item:hover {
	BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -50px; TEXT-DECORATION: none
}
.s4-ql UL.root UL > LI > A:hover {
	BACKGROUND: url(http://branding/team/SiteAssets/qlmenu.png) no-repeat 0px -50px; TEXT-DECORATION: none
}
.menu-vertical .menu-item-text {
	TEXT-TRANSFORM: uppercase; COLOR: white; FONT-SIZE: 1em; FONT-WEIGHT: bold; PADDING-TOP: 5px
}</style>

Brand SharePoint Series:

PowerShell for Developers – Part 2: Using the SharePoint OM


You may also be interested in: Build a Scalable Architecture by KnowledgeLake


 

Editor’s note: Contributor Adam Burcher is a SharePoint Developer and IT Admin working as a consultant for Mando Group. Follow him @sharepointbaker

2012-05-29-PowerShellForDevs-Part02-01.jpgThis is part 2 in my series on PowerShell and in this article we’re going to take a look at how to exploit the SharePoint Object Model through PowerShell. Having access to the out of the box cmdlets, like New-SPWebApplication etc, is really helpful but there’s a limit to what you can do with them. Creating a Farm, getting a Web Application and Site Collection up and running is fairly straight-forward with the standard cmdlets. However, when you start diving deeper into a site there’s not much out of the box stuff available.

This is where, if I put my developer hat on, I jump in and start looking at writing custom scripts. Once you start writing your own scripts there’s no limit really as to how far you can take them. I’ve worked on projects where the PowerShell scripts are 4 lines to deploy solutions and then other projects where PowerShell has its own project within Visual Studio and can generate the entire site collection including content! If you work in development teams on a project and/or have to deploy out the same things to multiple environments (dev, UAT, Stating, Production) then PowerShell could well become your best friend.

So how do you get started?

Well the first thing – can you do it with the out of the box cmdlets? Why spend time writing a custom script to create a new Web Application, when there’s a script that does it for you! So let’s assume then that we have a scenario where there is no out of the box cmdlet. The next step is to identify what the script needs to do. You can (and should) apply the same principles to scripting that you do for coding – identify methods, process flows, identify parameters etc. Just because you don’t compile the scripts doesn’t mean to should take any less time to plan them! If you’re new to PowerShell you might find it easier to write the code out in C# first. Once you have that code ready it doesn’t take too much to convert it to PowerShell.

In this post we’re going to look at writing a PowerShell function that we can use to add items to a custom list. Now in a lot of scenarios you may use an Event Receiver to achieve the same result – if you have in the past then that’s great because you’ll have the C# code you can use as a basis for the PowerShell. A question I get asked a lot is why would I script something rather than code it? Adding items to a list is a good example because a lot of the people would use an Event Receiver. There isn’t a right or a wrong way – it’s just different ways to do the same thing. Sometimes you won’t have a choice – client won’t grant you access to their server so you can’t run scripts, clients can’t provide data until after final code release etc. When there is a choice, then it’s down to preference. I like distingushing between code (e.g. C# logic), configuration (e.g. authentication method) and content (e.g. pages. lists) and being able to manage them independently – why should a code release be needed to update items in a list? Even if you disagree with that view, PowerShell is still worth looking at!

Now on with the script!

Part 1- Creating the list

First of all I want to script the creation of my custom list. For this example I’ve got a simple list definition in a WSP, CompanyContactlist, which let’s me fill in some information like Company, Contact Name, Telephone, Fax and Postcode (You can download the WSP at the bottom of the page). My PowerShell script needs to check if my list exists first and if it doesn’t, create it for me based on a custom list Template that I’ve deployed to my site. To help get started it’s helpful sometimes to think how you would go about this in C#. Let’s take a look at what that might look :



Hopefully this code should be familiar and you should get the idea of what this code is trying to do – first just get the RootWeb (that’s where I want this list to be created) and then using the TryGetlist method I can check to see if a list with the name ‘Company Contacts’ already exists. If it doesn’t then it’s a case of getting the list Template and passing through the information to SPWeb.lists.Add(). So let’s see how this would look in :



Here we have the first 3 lines of our script. Really there have only been two changes:

  • Replacing all of the variable names to include the $
  • Replacing ‘new’ with ‘New-Object’ with the full namespace to SPSite

Let’s look at the next bit of the script, checking the companylist object:



Again there hasn’t been that much to change from the C#:

  • Replacing ‘==’ with ‘-eq’
  • Replacing ‘null’ with ‘$null’
  • Replacing variables names to include $

And our final line just requires us to update the variable names. Technically speaking we now have valid and working PowerShell script to create out list. However, just as you would review you C# code to see if there’s any improvements, you should also review your scripts. For example, there may be things in PowerShell that you can exploit – like where, select etc which might improve your scripts. Another thing I find that’s useful is to include some logging information so you have some indication as to what’s going on. Logging doesn’t just have to be for diagnostics as it can be helpful for providing some reporting (There’ll be more of this in a future post!). The easiest way to do this is to provide some Write-Host to output a message.

So factoring all of this in, gives us the final script:



The final tweaks includes -

  • PowerShell gives us Get-SPWeb, so I’ve swapped that out from our original code
  • Rather than ‘$companylistTemplate -neq $null’ I can just check to see if ‘$companylistTemplate’ is set
  • Finally, adding various Write-Host to provide some information about what parts of the script have run

Part 2 – Populating the list

So now the list has been created I want to populate it with some data. This time however, rather than starting with the C# we’re going to jump right in to the script. Eventually I want this to be a function that I can call as required and it needs to be able to check if a value already exists before adding (I don’t want a list full of duplicates!). However, in this first iteration of the script I’m just going to add a new item to the list with the data so that we’ve got something to work with.

So here’s the first iteration of the script:



This should look a bit more familiar now – the first few lines focus on getting the list instance from the web and once we have our list we can call out to Items.Add() to create a new list item which can be be populated with data. If you ignore the $ this part of the script is then the same the C#. (By the way, Items.Add() in C# or PowerShell isn’t necessarily the best approach to use when adding items. When lists grow in size this becomes less performant – I’m using it here as a simple example).

If I’m only ever adding a single item then this script is fine, but it’s not really that reusable. So the first enhancement that I want to do it to make it a function. How you go about this is the same as if you were writing this as a method in C# – what do you want to turn into parameters? Clearly each of our fields (Title, Contact_Tel etc) should be parameters, but we also need to have access to the list as well. Here is where there’s a couple of options, for example do we:

  • Pass in the list object?
  • Pass in the Web object?
  • Pass in Web Url?

For this example I’m going to get the list object and pass that in as a parameter to my function, which means everything below the line ‘if ($companylist)’ is going to be added to my function. Now the parameters have been identied I can modify the script so that it looks like this:



We now have a reusable function that we can call and pass in information as we need it – something like this:



The final enhancement that I want to make is to do a check before we add a new item and to do this I’m going to write an SPQuery to see if an item already exists in the list with the same Title. If no item is found then the item will be added. Let’s take a look at the script and then see what it is doing -



First of all we are building up our SPQuery object – first by instantiating it and then by building the Query. Since the Query is dynamic, based on the $company parameter I’m using [string]::Format to build it. Then it is just the case of passing the $query object in the GetItems method and we have the results. I’m not really interested in the results, except to get the count. It’s at this point (if the count is 0) that the original code can be used.
Let’s see the final script with some logging and examples of it being called:



When this is run I get the following output:



Which means I can instantly see that 2 items were added, but the 3 was a duplicate.

What’s next?

Now we have a working script we could create a ps1 file which contains our function and data and any time we need to create this list and populate it we can just run this ps1 file. Could you use this script in Production? Almost. Before I use it I would go through and provide some extra logging information – with automation logging really is your best friend to see what has happened. I would probably also want to go through and provide some more validation and error checking – for example how does the ‘Add-CompanyContact’ function behaviour with a blank ‘company’ parameter? The script we created in the first part could also be converted into a function – pass in a list name and template and it will create it for you if it doesn’t exist.

Summary

On the one hand the scripts we’ve seen here are fairly simply but they do illustrate some of the potential that scripting has to offer. If you are a developer then I would really encourage you to take a closer look. The next time you have to make a change in SharePoint think about whether you can script it.

Download – if you want to use the same list definition as in this article, I’ve included the WSP which you can download from here as a zip. (like all code this site it comes with the disclaimer that if you install it, it’s your responsibility if it causes any problems on your environment!)

Hack SharePoint Master Pages: Part 3 – Major functional areas of SharePoint interface


You may also be interested in: the Outlook sidebar by harmon.ie


 

Editor’s note: Contributor Marc-André Bilodeau Lamontagne is a .NET developer at Group GSoft. Follow him @forumma

In my previous articles, we learned what a master page is and how it is working in SharePoint. We also saw, in the last article, how to include CSS and JavaScript files in our master page. In this third part of the series “Hack SharePoint Master Pages”, we are going to take a look at the major areas of a SharePoint 2010 team site interface.

Major functional areas of SharePoint interface

I’ve separated the team site interface in fourteen major areas. There is an image with the separation and a table with the title of every section. I’ve also included the content place holder ID when the section is in a content placeholder. I added the content place holder ID because it’s important to know which sections are inside a content placeholder. A content place holder is an area that can be overridden by a content page. That means a user with the appropriate rights, can create a new page and decide to change this content place holder to use his own content. Some of the content place holders are used by SharePoint in order to function properly, they are not all there to be overridden by the content page. You always need to keep it in mindm when you are modifying a page, to apply your own branding. Below are the image and table with all the sections.

2012-05-29-HackMasterPages-Part03-01a.png

2012-05-29-HackMasterPages-Part03-02.png

I didn’t list every area and every content placeholder because some of them are used in specific cases and I want to keep it simple to understand. If you want more information and a list of every content placeholder, you can read this article on MSDN.

It is important to decompose the interface to clearly identify what you want to change. You can’t change everything in one click, so you need to modify each section one by one to have a good result. It is not easy to open the HTML code of the master page and find the section you want to edit. A good way to find a section is to use SharePoint designer 2010. You need to find the master page you want to edit; it should be in the “Master Pages” section in the “Site Objects” tab. Right-click on your page and click on “Edit file in Advanced Mode”.

2012-05-29-HackMasterPages-Part03-03.png

You will now see your page in edit mode. Depending on the “mode” selected at the left bottom of SharePoint designer, you will see the HTML or not. We need to see the code and the design view. For this, be sure you are in “Split” mode in the bottom left in SharePoint Designer.

2012-05-29-HackMasterPages-Part03-04.png

Your main section will now be split into design view and HTML code. To find the section you want to edit, if you don’t know the name and where this section is in the HTML code, you can click on the section in the design view and that will select the HTML code automatically.

2012-05-29-HackMasterPages-Part03-05.png

We now know the major areas of a team site master page and how to find the section in the HTML code. That means we are now ready to edit the code and start customizing the layout of our page. In the next article we are going to take one section and see the possible modifications we can make to improve the look and feel of our site.

And the winner of the first EUSPHack is…

And the winner is… James Love! James wins the grand prize of any five books from the O’Reilly collection.

EUSPHack Winner

Thank you to the four contestant who participated in the first EUSPHack. From what I heard, everyone learned a little bit along the way and had a good time doing it. For those who intend on participating in the next next one, let’s make it clear from here: EVERYONE under-anticipated the amount of time it would take to create the solution. When we first started, there was an idea to do it in under three days. Even when we extended the competition deadline to 9 days, it was very difficult to find the personal time to create a working solution.

Thank you also goes to the three judges – Bil Simser, Marc Anderson, Mark Fidelman – for volunteering their time to not only give feedback on the solutions, but for keeping the trash talking going on twitter for the entire week.

Final thank you to Chris Riley at CloudShare for setting up the development spaces in a matter of minutes after our request.

Now we need to hear from you, the viewers. Was this worth doing, or I guess, is it worth doing again? If so, what types of solutions should we request. Keep in mind, there is limited time, the minimal solution has to be built in 7 days during spare time from work and play.

EUSP Hackathon – How We Did it Series:

SharePoint 2010: Reset Customized List Forms from InfoPath Back to Default


You may also be interested in: SharePoint Search and List Previews by Vizit


 

Editor’s note: Contributor Adam Preston is a Senior SharePoint Consultant for TCSC. Follow him @_apreston

If you have a SharePoint 2010 List Form that you have customized using InfoPath 2010 and for whatever reason need to revert back to the default forms, then follow this simple process below:

Customized form to replace

2012-05-28-RestCustomizedList-01.png

Located the list in question and use the ribbon to select List > List Settings

2012-05-28-RestCustomizedList-02.png

On the List Settings page, select “Form settings” under “General Settings“.

2012-05-28-RestCustomizedList-03.png

Change the Form Option from “Modify the existing InfoPath form” to “Use the default SharePoint form“. If you want to completely remove the form, also check “Delete the InfoPath Form from the server“.

2012-05-28-RestCustomizedList-04.png

The list form has now been reset back to the default.

2012-05-28-RestCustomizedList-05.png

SharePoint 2010 – How to change the approval workflow e-mail messages with SharePoint Designer


You may also be interested in: the only cloud-based Dev/Test solution for SharePoint by CloudShare


 

Editor’s note: Contributor Jasper Oosterveld is a SharePoint Consultant at Wortell. Follow him @SharePTJasper

In SharePoint Designer 2010 you have the option to attach and customize an approval workflow to a list or library. The workflow will send out multiple e-mails to initiator and approver(s). These e-mails can be modified. Let’s take a look!

The following e-mail is sent to the approver of the workflow:

2012-05-25-ChangeApprovalWorkflow-01.png

Customers are often not happy with the text of the e-mail because they want to make it more personal. I agree with this so we often change it. In this article I want to show you how this works.

In my example I attached an approval task to a document library:

2012-05-25-ChangeApprovalWorkflow-02.png

Click Approval:

2012-05-25-ChangeApprovalWorkflow-03.png

Now you have the option to change the configuration of the approval workflow! Not only the e-mail messages but you can also create multiple outcomes. To change the e-mail to the approver you have to click on Change the behavior of a single task:

2012-05-25-ChangeApprovalWorkflow-04.png

Click Current Task:Assigned To:

2012-05-25-ChangeApprovalWorkflow-06.png

Do you recognize the text? This is the e-mail message sent to the approver! We can start changing the text. Let’s make it more personal. Delete all the text above To complete this task and create the following text:

Dear “Full name of the approver”,

You are assigned by “Full name initiator” to approve the document: “Name document”.

Let’s start building this new e-mail.

Full name of the approver
Click Add or Change lookup and a pop-up will appear:

2012-05-25-ChangeApprovalWorkflow-05.png

You can now look for a value you want to use in the e-mail, in our case we want to show the display name of the Approver. Let’s select the following:

2012-05-25-ChangeApprovalWorkflow-07.png

Instead of Display Name you can also pick e-mail address or login name but display name is more user friendly.

Full name initiator
Click Add or Change lookup and select the following:

2012-05-25-ChangeApprovalWorkflow-08.png

“Name document”
Click Add or Change lookup and select the following:

2012-05-25-ChangeApprovalWorkflow-09.png

The e-mail sent to the approver contains a button Open this task. This will open the following menu:

2012-05-25-ChangeApprovalWorkflow-10.png

Sometimes this form won’t open so I always like to add a link to the SharePoint URL to open the form in the browser. You have to do the following:

Click this button 2012-05-25-ChangeApprovalWorkflow-10A.png and:

2012-05-25-ChangeApprovalWorkflow-12.png

The e-mail will contain a hyperlink to the online approval form:

2012-05-25-ChangeApprovalWorkflow-11.png

Pretty cool right? You can also change the look and feel of the approval form with InfoPath. Go to the the Forms section of the workflow settings and change this. I will show this in another article.

You are now ready to publish the workflow and you can test the changes by uploading a new document and checking the e-mail.

We only changed one e-mail but there are many more:

  • Approval e-mail to the approvers
  • Cancellation of the task
  • Completion of the task

To change these you have to go through the the following options:

2012-05-25-ChangeApprovalWorkflow-13.png

My advice is to first receive one of these e-mails and then look for them in an e-mail action in one of the options of the screenshot!

SharePoint: How to Create Multiple Cascade Drop Downs Using InfoPath 2010


You may also be interested in: the Outlook sidebar by harmon.ie


 

Editor’s note: Contributor Usman Ahmed is Senior Project Officer for Chester University.

Today, I will walk you through the steps to create an AV Asset form using InfoPath 2010 with multiple cascading drop downs. The form will contain the following information:

2012-05-18-CascadeDropDown-01.png
InfoPath 2010 AV Asset Form

In this AV form Equipment Type, Manufacturer and Model number are interdependent lists. If a user picks equipment type from equipment combo box, the list of manufacturers’ combo box should only show manufacturers which are related to this equipment type.

For Example when we the select equipment type Analogue Project, It will only show the manufacturers Kodak, Elmo, Simda and Sennhesiter.

2012-05-18-CascadeDropDown-02.png
SharePoint 2010 Equipment List

At next level when users select Manufacturer name then the Model list will show only the model number related to the selected Manufacturer and Equipment type.

For Example, a user selects Equipment Type=” Analogue Project” and Manufacturer = “Kodak” then only the model number, related to this equipment type and Manufacturer, will appear in Model list.

2012-05-18-CascadeDropDown-03.png
SharePoint 2010 Model List

Let’s start to implement our scenario.

Step 1:

Create custom Equipment Type List in SharePoint. This will look like the following list.

2012-05-18-CascadeDropDown-04.png
SharePoint Equipment List

Step 2:

Create a custom Manufacturer List in SharePoint. In this list we will use an equipment list as a look up field. When a user enters a manufacturer name, he must pick an equipment type. Basically in this list we are storing the relationship between manufacturer and equipment type.

2012-05-18-CascadeDropDown-05.png
SharePoint Manufacturer list

Our Manufacturer list will look like this.

2012-05-18-CascadeDropDown-06.png
Manufacturer list view

Step 3:

Create a custom Model List in SharePoint. This is where we will store model numbers against equipment type and manufacturer name.

In this list there are two lookup fields, one for equipment type and another for manufacturer’s name. We have also implemented a cascading drop down condition based on equipment type. E.g. when a user picks equipment type, the manufacturer list will be automatically filtered based on selected equipment type.

2012-05-18-CascadeDropDown-07.png
SharePoint 2010 Model list

To implement cascading, select list and click on List Tools in the bread crumb menu then click on the Customize Form with InfoPath icon button.

2012-05-18-CascadeDropDown-08.png
SP 2010 list bread crumb

In InfoPath the form will look like this: When we open the form in InfoPath there is already a default data connection created. But we need to create an extra secondary data connection for the manufacturer combo box, so we can bring in the equipment type field which we need to apply a filter to.

2012-05-18-CascadeDropDown-09.png
SP 2010 Model list design

Step 3.1

Create a secondary data connection. Click on Data Menu, Data Connections and Add Data Connection to receive data from a SharePoint list or library then chose the manufacturer list which we created earlier and select the following fields.

2012-05-18-CascadeDropDown-10.png
InfoPath data connection wizard

Finish and close this wizard.

Step 3.2

Click on Drop Down List Properties of the Manufacturer combo box and change the data source to the newly created data connection.

2012-05-18-CascadeDropDown-11.png
InfoPath combo box properties

Click on select X Path button next to the entries box.

2012-05-18-CascadeDropDown-12.png
X Path entries

Click on the Filter Data button and then on the Add button to specify filter conditions. The hierarchy of opened windows will look like this.

2012-05-18-CascadeDropDown-13.gif
SP 2010 Drop Down List Box filters

In the Specify Filter Condition form we are specifying conditions based on the equipment type field which is in the Manufacturer DS (which is our secondary data source that we created earlier) is equal to the equipment type field in our main data connection. This is the selected equipment type combo box’s value on this form:

2012-05-18-CascadeDropDown-14.gif
InfoPath list design

Save your changes and publish your changes to SharePoint. Now you can see that the cascade drop down condition is implemented on the Model list.

2012-05-18-CascadeDropDown-14.png
Model list after publish

Step 4:

Create an AV Asset form in InfoPath 2010.

2012-05-18-CascadeDropDown-15.png
InfoPath Asset Form

Here we are going to implement a cascading condition on the Manufacturer and Model combo box, whose values will depend on the equipment type combo box.

Step 4.1

We need to create three data connections to receive data from our SharePoint lists. This data connection will receive data from

  1. Equipment Type List (This will be the data source of the equipment data type combo box)
  2. Manufacturer List (This will be the data source of the Manufacturer combo box)
  3. Model List (This will be the data source of the Model combo box)

Our three data connections will look like this:

2012-05-18-CascadeDropDown-16.png
Data connections

Step 4.2

Change the data source of the equipment type Combo Box:

Right click on the equipment type combo box and click on Combo Box Properties.

2012-05-18-CascadeDropDown-17.png
Equipment Combo Box Properties

The Combo Box Properties windows will open, from the list box choices section we need to select get choices from an external data source.

2012-05-18-CascadeDropDown-18.gif
Equipment Data Connection

The Data Source Combo Box will be enabled. From the drop down combo box select the data connection which we created for equipment type SharePoint list.

Step 4.3

Using steps mentioned in step 4.2 change the data source for the Manufacturer combo box

Step 4.4

Using steps mentioned in step 4.2 change the data source for the Model combo box.

Now click on the preview button and verify all three combo boxes are displaying the right values from your SharePoint list.

2012-05-18-CascadeDropDown-19.png
Combo box with filters

Step 5

Implement cascading filters, so when we select equipment type we can see all relevant manufacturers of select equipment types and when values of equipment type and manufacturer are selected, the model combo box should show only relevant model numbers.

Step 5.1

Click on the properties of the Manufacturer combo box and click on select X Path button next to the entries box.

2012-05-18-CascadeDropDown-20.png
X Path entries

Click on the filter data button and click on Add button to specify filter conditions. The hierarchy of opened windows will look like this.

2012-05-18-CascadeDropDown-21.png
Combo Manufacturer Filter

In the filter data box we have mentioned a filter condition. Select only those records where equipment type in the manufacturer data source is equal to the equipment type selected from the equipment combo box in our form.

Now when we select the equipment type value from the combo box, it will only show relevant manufacturer names in the manufacturer combo box.

2012-05-18-CascadeDropDown-22.png
Equipment values

Step 5.2

To implement a cascading filter condition on the Model combo box we need to follow the same steps mentioned in step 5.1, apart from filter condition. In this case our filter condition will be like this:

2012-05-18-CascadeDropDown-23.png
Specify filter conditions

Here we are selecting all model numbers from the model source data connection where equipment type in the model data source is equal to the equipment type selected on the form and Manufacturer name in the model data source connection is equal to manufacturer name selected on the form.

Note: Model data source is a SharePoint List which contains all the information about models, equipment types and manufacturers.

2012-05-18-CascadeDropDown-24.png
SharePoint 2010 Model List

After applying above mentioned filter conditions, the Model combo box will show only relevant model number related to equipment type and manufacturer.

 2012-05-18-CascadeDropDown-25.png
Final list

Step 6:

Save changes and publish form to the SharePoint document library.

2012-05-18-CascadeDropDown-26.png