Open “I Need To” sharepoint web part issues and open links in a new window

Issue:
If you add two “I Need To” sharepoint web part on the same page the webpart on the top works fine, but the webpart on the bottom does nothing.

Solution:
1.Export the first webparts.

SPExportWebpart

Export WebPart

2. Modify the XSLT in the webpart. Give a new ID (e.g id=”TasksAndToolsDDIDBusinessTools”). Add a placeholder for href (e.g href=”#”). Add a onclick JavaScript event (e.g onclick=”javascript:LABusinessTools_jumpMenu();).

SPExportWebpartXSLT

Webpart's exported XSLT

3. Import the webpart. Edit the page. Click on ‘Add a Web part’. Click on ‘Advanced Web Part Gallery and Options’ on the add web part. Then import as show in the image below.

Import WebPart

Import WebPart

4. Find the portal.js on the SharePoint web server under “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS” and add
the JavaScript below. Make sure the ID you put in the XSLT is same as the ID use under document.getElementById().

function LAInternetLinks_jumpMenu() {
var el = document.getElementById(“TasksAndToolsDDIDInternetLinks”);
if (el != null)
{
var href = window.open(el.options[el.selectedIndex].value);
if (href != "0")
{
window.open(href);
}
}
}

5. Do step 1 to 4 for the second web part. The ID and the JavaScript name should be different.

Reference:
http://social.technet.microsoft.com/



Email

Advertisements

Diganta Kumar has architected and developed software for more than a decade for a wide range of industries and development platforms and over the years has filled many roles including program manager, founder, developer, architect, team lead, mentor and project manager. Diganta is founder of two online IT businesses. He is a certified AWS Solutions Architect, certified Professional Scrum Master (PSM I), certified Professional Scrum Developer (PSD I) and ITIL Certified. He has presented at Microsoft Tech.Ed, Microsoft AppFest and Ark Group Intranet conference. He attends AWS Seattle Official Events, Seattle AWS Architects-Engineers, and AWS Cloud Commerce user groups. He likes to help, mentor and manage software development teams to improve and produce great software. He currently work as a Senior Technical Program Manager for Amazon Web Services.

Tagged with:
Posted in SharePoint

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