Turning Quick Launch into a Tab control

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

First, let me start this post by saying that I absolutely love that navigation in SP2010 is completely standard HTML. This is a ‘codeless’ method for turning that left navigation quick launch in to a nifty tab control. The use case for this was that for some landing pages people wanted tabs rather than quick launch but for everything else the normal quick launch. So how do you change the quick launch as needed to tabs? The answer is pretty simple.

Before we get into the details of how to build this, let’s take a step back and look at what the quick launch HTML looks like: Read more of this post

SharePoint Search with Pagination

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

This is an example class for showing how to search SharePoint with paging support in the API. This function accepts a string containing the standard SharePoint SQL style search query:

ie: SELECT TOP 50 AccountName, Size, Rank, Path, Title, Description, Write FROM portal..scope() WHERE “scope” = ‘People’ AND CONTAINS (“LastName”,’”Doe”‘)   ORDER BY “AccountName” DESC

To page you can use the optional int rowCount and page overloads. Whenever page is specified it judges the start row as rowCount*page. So page 10 begins at row 500 if rowCount is 50. Read more of this post

Using Native SharePoint Form Fields

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

When making a generic web part for modifying or interacting with different SharePoint data you can’t always predict the column data type before hand.

The best way to make sure your web part works regardless of what data is being tossed in to it is to just use the out of box SharePoint Form Field control. This control goes ahead and grabs the column edit and display templates depending on the state you specify.

Below is a code snippet example of how to use this control. Takes a lot of the headache out when dealing with unknown data types/building generic web parts.

Read more of this post

Data View Web Part Tricks

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

One of the most handy out of the box customization components in my opinion is the Data View Web Part, but mucking around in XSLT can be a pain at times so here’s some reference points for making things easier, these work with SharePoint 2007/2010 and anything else that can use XSLT.

The first snippet is for pulling unique values down from your data source initially. The second is the much more fun way to make it so the DVWP filter drop downs are unique per column. The filter drop down unique value code snippet is put in to the template and is field type independent. Next we have an XSLT template for changing a string to be all uppercase to make a query comparison case-insensitive effectively, it can also be used for always showing a field as uppercase.

I also pasted some of my older XSLT tidbits related to truncated strings for Read More links and proper string extraction for rendering url and image fields. Read more of this post

Accordion Data View Web Part

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

Even more ‘fun’!

Making nifty things with jQuery with the data view web part.

First component is a jQuery powered faked accordion script with highlight of mouse over.

A real accordion will not work in DVWP due to how the markup is output.

Requires:
jQuery WebUI plugin

Here’s the code: Read more of this post

Multiple Entry Single Field

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

This is a method I came up with to use jQuery to fake an n+1 relationship for one or more columns within a single list item. You can see in the image below that the user is initially presented with the designated fields empty; they have a button for adding the new ‘rows’ in to the fields specified. This is a simple method for basic scenarios where you need a relational style input within a single form.

The code works by adding an event handle to each new text box inserted that is triggered on KeyUp to concatenate the values into a CSV list that is stored in the hidden original field. So if you have added three ‘rows’ you would get something like this saved: “Value1,Value2,Value3,”

To use, insert a content editor web part and edit the [title=”Column” selector to be the display value of the field to treat in this manner.

Read more of this post

Force Page Edit Mode in SharePoint

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

On some SharePoint pages there is no simple way to get to the edit web page view to add/modify/remove web parts. However, SharePoint accepts a QueryString for opening a page in edit mode:

HTTP:\\MYSHAREPOINT?ToolPaneView=2&pagemode=edit

By adding this to the end of any URL where you have rights to edit the page you can then go ahead and edit the page to your hearts content. This is particularly useful when doing modifications to NewForm/EditForm without dissociating the page, or making your own form page.

- Maarten

Extending the size of the Rich Text Editor

Slalom Consultant Maarten Sundman

Slalom Consultant Maarten Sundman specializes in .NET, SharePoint, and Silverlight solutions and has experience in the Financial Services, Software, and Utilities and Energy sectors.

by Maarten Sundman

So an issue I’ve heard many times from end users is that the rich text editor is way too small to do verbose content. Below you’ll find some CSS which increases the size of the Rich Text Editor and the list form in general to be both wider and in the case of the RTE, taller as well. In practice with the below changes about one-third of a page will be editable on-screen at any one time.  This is for SharePoint 2007, and can be added as a new .css to your master page. Or inline to an individual page via the content editor web part.

larger RTE in SharePoint CSS

Read more of this post

Follow

Get every new post delivered to your Inbox.

Join 217 other followers