Second Life of a Hungarian SharePoint Geek

September 12, 2009

Customizing the I need to… web part

Filed under: SharePoint, Web part — Tags: , — Peter Holpar @ 03:30

Recently I got a question about how one can customize the I need to… web part. The green button has to be removed and on selecting an item from the drop down list, the browser should navigate to the URL that is assigned to the selected item.

After some investigation I found a solution for the request, that I would like to share here.

First we need to delete all instances of this web part from the page. Then add a new one, but make no customization on it, instead export the web part.

To do that:

  • From the Site Actions menu select Edit Page.
  • From the edit drop down of the I need to… web part select Export…
  • Save the file to the file system.

Open the exported file in a text editor, like Notepad.

Modify line 76 (add the content in bold):

<select id="TasksAndToolsDDID" class="ms-selwidth" 
style="width:{$tasksAndTools_Width}" size="1" title="Choose a task that you need
to perform"
onchange="TATWP_jumpMenu()" >

Modify line 84 (add the content in bold):

<select id="TasksAndToolsDDID" class="ms-selwidth" size="1" title="Choose 
a task that you need to perform"
onchange="TATWP_jumpMenu()"
>

Delete lines between 92 (<xsl:if test="$tasksAndtools_IsRTL = true()">) and 105 (</xsl:if>).

Save the file.

Delete the I need to… web part from your page again. Import the web part from the modified file to the page. If you don’t know how to do that, here it is step-by-step:

  • From the Site Actions menu select Edit Page.
  • Click the Add a Web Part label in the web part zone you want to add the new web part to.
  • In the bottom right hand corner of the dialog click Advanced Web Part gallery and options.
  • There is a drop down arrow in the top right hand corner of the task pane next to to Browse label.  From this drop down select the third option: Import.
  • Browse to the modified file in the file system and click Upload and next click Import at the bottom of the page.

Configure the new web part as needed, press OK, then refresh the page.

If you don’t know how to configure this web part, see this post in Nicholas Bisciotti’s Blog.

The result of the customization is shown below:

image_thumb2

When selecting an item from the drop down, the browser is navigate to the selected target, as required.

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: