Friday, February 29, 2008

How to hide View: menu on the right-hand-side of the SharePoint 2007 toolbar?

  • Display the view in a browser
  • Open the source in an editor. This is done by "right-click / view source" in IE
  • Search for "ms-listheaderlabel". It will land on a <td> tag.
  • Right under that <td> tag you will find another <td> tag with an ID like: ctl00_m_g_672c28cb_9a7b_4898_a26c_22eefe71074d_ctl00_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_onetViewSelector
  • Copy the ID into the clipboard.
  • Create a style in an editor as follows and use the ID that you copied into the clipboard:

<style type="text/css">

 
#ctl00_m_g_672c28cb_9a7b_4898_a26c_22eefe71074d_ctl00_ctl00_toolBarTbl_RightRptControls_ctl00_ctl00_onetViewSelector{

visibility:hidden;

}

.ms-listheaderlabel {

visibility:hidden;

}

 

</style>
  • Click on "Site Actions / Edit Page"
  • Add "Content Editor Web Part" to the page.
  • Cick on "open the tool pane"
  • Click on the "Source Editor ..." button on the far right-hand-side of the page
  • Copy and paste the <script ...> code from your editor into the "Text Entry -- Webpage Dialog"
  • Click "Save" button
  • Click "OK" button
  • Click "Exit Edit Mode" link.

No comments:

Post a Comment