If you want to display a link that allows you to create new items in a SharePoint 2007 document/form library, you can easily do that in a Content Query web part. Just do the following:
1. Navigate to the library where you want to be able to create new items.
2. Open up the source code of the page and search for the string “onclick=”createNewDocumentWithProgID(‘”
3. That’s the “New Document” link. Steal it! Copy everything that pertains to the onclick event.
4. Navigate to the page where you want to add the new link.
5. Add a Content Query web part
6. Edit the “Source Code” and add the following:
<a onclick=”THE ONCLICK EVENT YOU NICKED FROM THE LIBRARY PAGE SOURCE CODE” href=”#”>Some Display Text</a>
That should create a link for you. The onclick event is on your master page so don’t go looking for it in order to add a javascript. It’s there already. The ‘href=”#”‘ part is there to provide a uniform experience for the user. Without it, the display text will appear and clicking on it will still navigate to the new item creation, BUT the little hand shaped cursor will not appear when you hover over the link. The href bit will tell the browser that there is a link there, the cursor will change to a little hand and clicking on the link will allow the user to create a new document in the relevant library.
I’d like to thank you for the efforts you’ve put in
penning this website.
Ah, thank you!