Posts

Showing posts with the label SharePoint Branding

How to Remove “+ Add document" from a SharePoint 2010 Document Library

Image
In previous article , we have learned how to hide upload button of document library. In this post, we will see how to remove the “ + Add document” option from the document library in SharePoint 2010. We will get some scenarios where, we will display the document library I different view and in that, we don’t want this option to be shown to the users. Because, it will allow the users to upload the documents. Suppose the below is the document library where we want to hide the Add document option   We can achieve this by the following methods 1.    Editing the WebPart 2.    Using SharePoint Designer(CSS) 3.    Using J Query 4.    By Permission level(Default) 1. Editing the WebPart Go to Edit WebPart -> Tool bar Type -> Select NoToolBar option which will hide the Add Document option 2. Using SharePoint Designer(CSS) Go to the designer and edit the page/webpart where you want to hide. Search for  class=”ms...

Hide the Upload Button of the Doucment Library

Open your site using SharePoint Designer.  Once opened, navigate to your Library and edit your default view.  (All Files -> Your Library -> Forms -> Your View.aspx , right click and select Edit File in Advanced Mode) At the bottom of the screen you will see three options Design, Split, and Code.  Select the Split option. In your code window, locate the  <asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>   tag. Now, scroll down and find the closing  </asp:Content> tag.  Insert a line above the closing tag.  Place the following code into that newly created blank line. <style type="text/css">  #Ribbon\.Documents\.New\.AddDocument-Large { display:none; }  #Ribbon\.Library\.Actions\.OpenWithExplorer-Medium { display:none; } </style> Click save, then refresh your page.  The Documents tab should now be missing the Upload Document button and the Library tab should be...

Sharepoint 2010 fixed width master page design

Image
 i usually post solution here that i tested well and it suitable for sharepoint 2010 world. i find so many drawbacks to design fixed width master page and finally i found below solution is best. Open up your master Page and remove scroll="no" from the body. If you do not do this there will be no scroll bars on long pop up modal windows In the Master Page search for “s4-workspace” remove this whole DIV tag and its close Div tag at the bottom of the master page. This ID is tied to a JavaScript file that forces a full width on the page. Now Open up your CSS file and add the following: body { overflow:auto !important; } form   { width:980px; margin: auto; } Your Site Should look something like this: If you wanted to add some background color and borders to enhance the centered design replace it with this: body{ overflow:auto !important; background-color: #21374c; } .s4-widecontentarea{ backgr...

Create Top Navigation for SharePoint Custom Master Page

As the part of customization masterpage sometimes you need to add top level navigation with specified sites. Here is the coolest way to achieve this using aspx menu bar control. Create a visual webpart in visual studio 2010 and add aspx menu control on the user control. <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" CssClass="xxxxx"><asp:Menu> // Apply styles as your wish Take a custom list and create column [ ex:MenuUrl]   that using for url of the top navigations[Ex: https://xxxxxxx/home.aspx]. And add this list content to aspx menu on page load event as shown in below code. protected void Page_Load(object sender, EventArgs e) {   if (!IsPostBack)   { SPWeb web = SPContext.Current.Web; SPList list = web.Lists["ListMenu"]; SPListItemCollection items = list.Items; // get the list item for menu control //Title is the display name and MenuUrl refers the navigation url. ...