Friday, December 7, 2012

Hide List Menu in SharePoint 2007

This post is for my future reference. I was working in InfoPath 2007 form (with Document Library) and there was a requirement to stop user creating new forms for few days. So my ultimate goal was to hide NEW menu. With my research, I got to know that via SharePoint Designer and JavaScript, we can hide this menu. 


  1. You can open your site in SharePoint designer.
  2. Open AllItem.aspx page (if this is your default view) of your InfoPath Form form library.
  3. Switch to Design mode and Right click on list.
  4. Select "Convert XSLT data view".
  5. Now, you can make changes on controls available on *.aspx page.
  6. Select NEW menu and then move to Split view and you will see  the XSLT code"

<SharePoint:NewMenu runat="server"></SharePoint:NewMenu>" 
//Set the "td" visibility as "hidden":
<td class="ms-toolbar" nowrap="" style="visibility: hidden">
<SharePoint:NewMenu runat="server" ></SharePoint:NewMenu

</td>
<td class="ms-toolbar" style="visibility: hidden">|</td>

7. Save your page on Designer.
8. Refresh your page in Browser to see the change.
9. There is a limitation with this approach. Now, you cannot modify default view of this List on SharePoint.You can revert to list view web part by right clicking on dataview web part and selecting "Revert to SharePoint list view" and try other suggested options.
OR
To add new fields or update fields sequential orders, open the page in SharePoint designer and right click on dataview web part and select "Show Common Control Tasks". Now, select "Edit Columns..." option to add new fields.
Follow link over here, if you want to use JavaScript to hide menus.