The 'add new item' link which is always located at the end of the list. Is there a way that we can add a similar link at the top of the list?

-

Not possible by just configuring web part. Of course you could modify the Title Url of the web part to point to the Add new item URL, but I don't count that as a valid suggestion ;)

I would use javascript (jQuery) to search for the bottom Add new item link and inject similar to the correct position below the web part title.

Some web parts also allow you to edit the XSL of the web part. I haven't tried this myself, but you might be able to achieve the same in certain web parts using this method.

jQuery example (not on my dev machine now, so will share the idea at least):

1. Find the Add new item node using ID and get it's html: $('table[summary='yourtablename'] td[class='ms-addnew']).html() 2. Find the web part table, it should have "summary" attribute that might be easiest to find$('table[summary='yourtablename'])
3. Append the Add new item TD you got from step 1 wherever you wish, or get the TR above that TD and append the row below/above column header row of the table
4. You may want to change the ID attribute of the actual link to some other as there might be conflicts if you have two links with same ID attribute in HTML)
-
Hi Jussi, could u provide a example as to getting the "add new item" link using jquery –  spStacker Jan 31 '12 at 15:23
Hi, edited the answer above. –  Jussi Palo Feb 1 '12 at 21:12
Thanks jussi for the reply.i will try it at work tomorrow –  spStacker Feb 2 '12 at 3:55

You can edit the page to add a Content Editor Web Part up top and adjust the chrome type so that title / borders / etc don't display. Then edit the content of the web part to be a hyperlink to the same place as the other one.

-

Copy the HTML markup from the existing Add new item link. You can see it with help of the F12 developer tools of internet explorer or inspect element of Firefox/Chrome.

Example:

<SPAN style="POSITION: relative; WIDTH: 10px; DISPLAY: inline-block; HEIGHT: 10px;    OVERFLOW: hidden" class=s4-clust><IMG style="POSITION: absolute; TOP: -128px !important; LEFT: 0px !important" alt="" src="/_layouts/images/fgimg.png"></SPAN>


Paste the HTML markup into the Content Editor web part.

You may need to wrap the above code in a div and additional styling to it as needed.

-
thanks for your valuable answer dhirschl –  Naresh Nemuri Dec 8 '11 at 6:04
but Mr.dhirschl,i wants the bottom link to be removed –  Naresh Nemuri Dec 8 '11 at 6:08
Change the toolbar type to No Toolbar in the XSLT List web part properties. –  NLV Dec 12 '11 at 13:52

Actually, the simplest approach and probably best solution is to simply link to the form on your site ending with NewForm.aspx. It looks even better if you add the + image in fron too. Example: New Issue Tracking Form

-

Assuming you have jQuery available in your environment. Here is a quick way to knock it out.

<script type="text/javascript" id="ms-addnew_js">
$(document).ready(function () {$('.ms-addnew').filter(":last").hide();
});
</script>

-
But the catch is that JQuery solutions always comes with a latency. You'll see the link for a minute. The best way is to edit the XSL underneath the List XSLT web part in the view page. –  NLV Dec 12 '11 at 13:52

This code must work with JQuery.

var $addnew =$('.ms-addnew');
($('#WebPartWPQ2').prepend('<br>')).prepend($addnew.html());

-