Out of the box, SharePoint 2010 offers several styles that can be selected when creating a view of a list or library. One really useful style is the Preview Pane. If you have a list with a lot of columns, the Preview Pane style is great for creating a vertical view of the data, avoiding the dreaded horizontal scroll. If you’re not familiar with the Preview Pane, Microsoft has a quick screen cast that shows how to use it.
Unfortunately, out of the box, there’s no way to identify which column should be used in the pick list – that list of items on the left side of the preview pane. It defaults to the title column, and there’s no way in the web-based tools to modify that. So, what happens if for some reason you’re not using the title column in the intended manner? Well, you end up with something like this:
Not so great, right? If you Google around for a solution, you’ll find options such as using a workflow to update the title column with the data you want when an item is added or using a CAML editor tool. Hm…. No thanks.
Turns out that you can make it work with a little help from SharePoint Designer. Fire up SharePoint Designer 2010. Load your site. Navigate to your list. In the Views module, click the preview pane view that you created. (If you haven’t created one, watch that screen cast and create one first.)
Now that you’re in edit mode for the Preview Pane style, do any of the typical tweaks you might do on any view – change the sort order, the paging, add or remove columns. Do everything you might want to do using the Ribbon options before we get to this next part. It makes life easier.
Now for the fun stuff.
Find either the title or the words “(no title)” in the left column. Highlight either the title in a row of data or the “(no title)” words. Right click, and select “Edit Formula.”
A pop-up window will open where you can select another column of data, enter static text, or use any number of formulas to generate the text you want to use. I concatenated two columns.
If you have some rows of data with titles and some without, you’ll need to repeat this process for both types of columns.
So, what’s happening behind the scenes is that a new XSLT template is being added to code view. It’s called the “LinkTitleValue.LinkTitle” template, and it determines what data is being used for the link to the item. The template looks like this:
<xsl:template name="LinkTitleValue.LinkTitle" ddwrt:dvt_mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:param name="thisNode" select="."/>
<xsl:param name="ShowAccessibleIcon" select="0"/>
<xsl:variable name="titlevalue" select="$thisNode/@Title"/>
<xsl:choose>
<xsl:when test="$titlevalue=''">
<xsl:value-of select="concat($thisNode/@Chapter_x0020_Name, ' - ', $thisNode/@EIN)"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$HasTitleField">
<xsl:value-of select="concat($thisNode/@Chapter_x0020_Name, ' - ', $thisNode/@EIN)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$titlevalue" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$ShowAccessibleIcon">
<img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="{$idPresEnabled}" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:template>
Save your file and test it. Looks great, right?
You have now successfully replaced your title with your preferred information and it’s linked to the item. It also has an ECB menu attached to the item.
What happens if we use the ECB menu to view or edit the item? Oops! The Javascript gets confused and it drops out the text we just spent our time putting in there!
I haven’t dug into why this is happening, and I’m sure someone else will do that. (Leave a comment if you figure it out!) But, I do have a workaround. One more step. I find this step easier to do back in the browser. So, save and close SharePoint Designer. Fire up notepad and type the following:
<style type="text/css">
.s4-ctx {
display:none;
}
</style>
Save it as a text file and upload it to your site. Make note of the location. (Right click and “copy shortcut.”) (I used the “site assets” library.)
Navigate to your view. Select Site Actions -> Edit Page. Add a Content Editor Web Part and edit the web part to add a Content Link. Paste the shortcut and click “Ok.”
Save your file. Your “title” pane will now have the data you want, minus the ECB menu. Hovering over the item will load it in the preview pane. Clicking it will load the pop-up window for viewing or editing the content. One caveat, and Microsoft insists it’s a “feature – not a bug,” is that you’ve now lost your view menu in the breadcrumbs. (Glyn Clough provides more information about this issue. And Pentalogic has a free solution that fixes the issue on all pages, but may be a bit “nuclear,” as they put it.)
The workaround for that is to edit the page in SharePoint Designer to add your custom css. However, this customizes the page. You’ll have to choose whether you’d rather deal with customized pages or an alteration of the the UI. If you want to customize the page and retain the breadcrumbs, remove the Content Editor Webpart and save your page. Fire up SharePoint Designer again. Navigate to your list. Right click on your Preview Pane view and select “Edit File in Advanced Mode.”
Note: If you do not have the Edit File in Advanced Mode option, it is because your site collection or farm administrator has restricted the use of SharePoint Designer in your environment.
Once your view loads in advanced mode, switch to code view and search for “PlaceHolderAdditionalPageHead.” Add the CSS we had previously added via the Content Editor Webpart to that tag, like so:
Save your file. Voila – you now have customized title pane with no ECB menu and have retained the view selector breadcrumb.
The other major advantage of using this method versus the Content Editor Webpart is that the CSS will render in the head of the page, where it belongs. However, if you do choose to use this approach, make sure you are tracking what pages you are customizing so that when it comes time to upgrade you’ll know which files need to be double-checked.











Sarah
/ November 4, 2011Thank you so much! I tried another code from another Web site and it didn’t help.
Yours did! Changing the formula, it wouldn’t work; I actually had to replace the code you provided, starting with the . So thank you!
Deanna
/ November 4, 2011I’m so glad it worked for you. Not sure why changing the formula didn’t work. I also have discovered some funkiness if there are folders in the list – that changes things a bit.
Sarah
/ November 9, 2011Yeah not sure. So my new problem is that when I go to select my new awesome view into a Web part, it will show it as a view, but doesn’t show the changes I made to the left side, it still shows the contact name. Any ideas??
Deanna
/ November 9, 2011Hm.. Yah, I hadn’t used it as a webpart. And, yah, that’s what happens for me, too. I’ll have to do some investigation. I’ll post an update when I figure it out.
Sarah
/ November 9, 2011Wow, thanks so much!! I’m so new with Sharepoint so I’ve been doing a bit of fiddling around but afraid to go too deep.
Deanna
/ November 10, 2011Okay, so here’s the deal. If you use it on another page as a web part, you have to go through the same steps to format the title and add the css to hide the ECB all over again. I’m not sure why. Clearly, what I’m doing is not exactly what Microsoft intended. So, these sorts of oddities are bound to happen. But, you can definitely do it.
Sarah
/ November 14, 2011ECB…edit control block…not sure what that has to do with the preview pane style?
Deanna
/ November 14, 2011When you use the preview pane style, they attach the ECB (the down arrow that lets you access the edit menu) the title item. All well and good unless you change the title item. When you do, if you click the down arrow, SP gets confused and drops out the title. Look at the screen shot here: http://deannaschneider.files.wordpress.com/2011/10/ecbmenuerror.png
As soon as you click that down arrow, the text for the title disappears. The only workaround I’ve come up with is to hide the ECB menu by setting it so that it doesn’t display via the CSS.
Make sense?
Sarah
/ November 18, 2011I think I understand. However, when I tried it, it removes the ECB but doesn’t show my left side change.
Here’s a screenshot of the successfully changed preview pane view to show organization, not name, on the left side:
http://houserepublicans.wa.gov/temp-intranet/39Preview.jpg
I inserted the text file (copied your code) into the documents of this sub-site I’m working on.
Here’s me on the page I created, selecting the “39Preview” view for the Web part:
http://houserepublicans.wa.gov/temp-intranet/Selecting39PreviewView.png
And here’s the result when I click ok and save the page:
http://houserepublicans.wa.gov/temp-intranet/PageWith39PreviewWebPart.JPG
While it definitely removes the ECB, it doesn’t change my left side view.
Didn’t get to the breadcrumbs fix, because I’m not too worried about that right now…
Deanna
/ November 18, 2011I think you missed the part where I said that if you’re doing it on a page that isn’t the view page itself, then you have to open that PAGE in SPD and redo your customizations. In other words, you use SPD to customize a view IF you’re using it on the default view page. If you’re using it on a Web Part Page, don’t bother customizing the view. Add a view using the preview pane style to the page and then customize the webpart on the page.
Make sense?
The bonus is that on a web part page the breadcrumb thing isn’t going to be an issue.
Sarah
/ November 18, 2011The code isn’t the same in the page as it is in the view. So I don’t know which code to replace? I don’t see a way to just edit the Web part code?
Sorry to be a total pain…I really appreciate your help!!
Deanna
/ November 19, 2011I’ll try to do a screencast on Monday. I can’t access my test environment from home. But, if you follow the instructions (right click on the title field and then select “edit formula” and select the column you want to display), you shouldn’t need to alter the code directly. It should do it for you automatically.
Annie
/ April 13, 2012Wow!!! just the thing i was looking for…Thank u soo much it worked!!!1
Lewis
/ July 9, 2012I’m trying to use a custom column that formats as a picture for my picker column. Can’t get it to work though. It only displays the url path instead of the image. Any advice would be appreciated.
Deanna
/ July 9, 2012I don’t have any off hand experience doing that. But, I’m guessing it wouldn’t be much different. On your select tag, did you add disable-output-escaping=”yes”? So, in your XLST template, you’d have something like so:
<xsl:value-of select="$thisNode/@YourImageColumn" disable-output-escaping="yes"/>
Pinguwien
/ November 22, 2012Your Tutorial is really great. Thank you so much! I just have another question and perhaps you could help me with that, too? It’s merely simple, but I haven’t found an easy solution yet. In the standard List view, there is a Link to the “add new element” form below the list . When I use preview pane, sadly it’s not appearing. I know that it’s there when you click the ribbon, but I want the link
And I haven’t found such an option yet. Would be great if you could help me out.
Best regards,
Dominik
p.s: Sorry I use the german version (for I am german) of SharePoint so I don’t know the exact english descriptions. I hope you understand what I want.
Dreambox
/ January 4, 2013Can you tell us more about this? I’d care to find out some additional information. Name is MAXWELL From Port St. Lucie
Keith Casey
/ January 15, 2013So we have a blank Title Field from exporting an Access DB to a list. All we wanted was the Part Number to be the ‘Title’. No matter what we tried to do in Access to export it, SP2010 added a title field (exporting from Excel I’ve been told takes the 1st Text/Single String, but we wanted to keep relationships).
Once nice thing is we’re moving away from Access for tracking and adding new items, so this will be a solely web-based solution for item tracking.
Pouring over this issue since yesterday morning, the lightbulb went off on how to make the Part Number field the Title Field. Like, the get hit in the head with a brick type of answer.
If you didn’t want to concatonate the list on the left pane from 2 separate fields, my rough around the edges solution was…
“How to make the Title Field contain the content of a Column”
1) Open the List in Datasheet View
2) Select all the cells from “Part Number”, right click, CUT.
3) Wait a bit while SP syncs.
4) Select the top cell in “Title”, right click, PASTE.
5) Browse CNN for a few min in another tab while the sync goes on.
6) Delete the old “Part Number” row.
7) Rename “Title” to “Part Number”
I could not believe how easy that was to do and solves our problem. Of course, you can name the “Title” whatever you want to match the column you’re going to delete.
One thing to remember… when referencing that column name, it’s still known as “Title” and not “Part Number”. Part Number (Or whatever you named it) is just a display tag, as “Title” is a needed and reserved system name).
Now on your forms or list, you can re-order it as you want too, just that in the preview pane, it’ll take “Title” or your new name as the link/mouseover/ECB.
Mitchell
/ January 18, 2013Deanna, I’ve followed this fairly successfully, but I don’t know how to change the title field (with the link to view the item) to simply the text of the title field (without the hyperlink). I just want the users to hover over the names on the left column of the preview pane, without clicking to view it. Any ideas?
Deanna
/ January 18, 2013To get at that, you’re going to have to click on Design in the List View Tools part of the ribbon and then click the “Customize XSLT” and choose to customize the entire view. Then, you’re looking for this (search for “301″):
<a onfocus="OnLink(this)" href="{$FORM_DISPLAY}&ID={$ID}&ContentTypeID={$thisNode/@ContentTypeId}" onclick="EditLink2(this,{$ViewCounter});return false;" target="_self">
That’s where the link is built. Change the a to a div (don’t forgot the closing div), remove the onClick function, and you’ll still have the hover effect. It’s not the most semantically correct (div with a href? Hm….). But, it’s a quick hack to do what you’re asking. The more correct way would be to take the onLink(this) function and make it work with properly with a div instead of an anchor.
ian
/ January 28, 2013You are a pimp.
Clyde
/ February 2, 2013Right now it seems like BlogEngine is the preferred blogging platform available
right now. (from what I’ve read) Is that what you are using on your blog?
Oz
/ February 13, 2013Hi, thank you for this, exactly what I was looking for
I made it so that the list shows the name of suppliers rather than the title, but now the pane shows Title AND Supplier and both are the same.
Title is hidden from forms and is not a required field. If I go into the view controls to remove it it is greyed out.
Also, I can’t get the breadcrumb bit to work. I’ve insterted the code exactly as instructed but it’s not effecting the page. Is there any obvious thing I may have missed?
Any help on this would be greatly appreciated.
Thanks,
Oz
Deanna
/ February 14, 2013I’m assuming you mean in the preview pane itself, right? For that, you need to do some more XSLT customization. So, with your cursor in the preview pane, go up to the list view tools -> Design part of the ribbon. In the “Actions” section, there’s a “Customize XSLT” drop down. Choose, “Customize Item.” Now, find where the XSLT loops through the fields and displays them. (Click in any of the preview pain rows and it should put you in roughly the right place in the code in split view.) You’ll need to wrap that table row in an if statement, like so:
<xsl:if test=”@DisplayName != ‘Title’”>
<tr>
<td nowrap=”nowrap” valign=”top” width=”190px” class=”ms-formlabel”>
<nobr>
<xsl:value-of select=”@DisplayName”/>
</nobr>
</td>
<td valign=”top” class=”ms-formbody” width=”400px” id=”n{position()}{$WPQ}”>
</td>
</tr>
</xsl:if>
Make sense? This displays everything except the title. Obviously, alter the IF logic to meet your needs.
Oz
/ February 14, 2013Morning,
Having slept on it I realised my mistake: that I need to press save, rather than refresh then save. Weird, but it worked.
Could still do with some help on the title thing, though it’s not super important because I just hid the Supplier name field and left the Title field as an acceptable work around.
Thanks once again, your solution has fixed two major problems I was having!
Oz
ER
/ March 27, 2013Very, very nice. Thank you.