Welcome to Office Zealot Sign in | Join | Help

John Roe

SharePoint
I need to... web part
The I need to... web part, AKA Tasks and Tools web part can be used for more than just pointing at the Sites Directory. It can be useful as a standard jump menu, and configured with a different set of button images. There are some standards you have to follow in order to point this web part at another list or library and unfortunately if you put two instances of this web part on the same page it will break without some additional javascript.
 
The list that you point to must have a URL field thats the hyperlink field type. It also has to have at least one choice field for the filter. The filter value determines which items in the list or library will show up in the web part. If you export the webpart or look at a page with it in SharePoint designer you will see the references to images within the xsl property. You can can change these images to your own and then reimport the web-part to change the button.
 
If you want multiple instances on a page you will need to copy and rename a function from the portal.js. Portal.js is found in the \TEMPLATE\LAYOUTS folder. The function you are looking for is:
 
function TATWP_jumpMenu()
{
    var el=document.getElementById("TasksAndToolsDDID");
    if(el != null)
    {
 var href=el.options[el.selectedIndex].value;
        if(href != "0") 
        {
            STSNavigate(href);
        }
    }
}
 
By copying and renaming the function and ID and then changing the appropriate references within the web part you can have a second Tasks and Tools web part on the same page. Remember you will have to include the new javascript file at the top of your page. I recommend creating a new one instead of modifying the portal.js.
Posted: Monday, October 08, 2007 2:05 PM by John
Filed under: ,

Comments

njac_filoz said:

i am new in sharepoint development .... would you be able to help me make the hyperlink open in a new window .....

thanks in advance

# October 13, 2008 11:27 PM

LitoCueto said:

For opening a new window:

Edit the portal.js in the 12 hive - layouts folder or put inside the masterpage ---- the below script:

function TATWP_jumpMenu(dropDownId)

{

var el=document.getElementById((dropDownId != undefined) ? dropDownId : "TasksAndToolsDDID");

if(el != null)

{

var href=window.open(el.options[el.selectedIndex].value);

if(href != "0")

{

STSNavigate(href);

}

}

}

# October 14, 2008 5:06 PM

dozzee said:

I'm trying to put the multiple "i need to" fix, but I'm not sure how to do it.  I could not find my local copy of portal.js.  What I did do was to copy the code from above and I tried to place the funtion on the page where my webparts will be.  Because my experience with coding is VERY minimal, I'm not sure where to place the function.  I did rename it and changed the 2 function calls associated with my 2nd webpart, but it's still not working.  I'm thinking I'm missing something in the way I copied the code over.  Is there anything else I needed to do to the function besides rename it.  Did I need to have a language tag on it?  Can you confirm which page I should be adding it to and exactly where in the code I copy copy it.  And what if anything beside the name should I change in the copied funtion.  Thanks in advance for your help!  dozzee

# October 17, 2008 8:53 AM
Anonymous comments are disabled