Friday, February 24, 2012

Hide NEW document symbol in green color

I have form library in sharepoint 2010. In that library list workflow is associated. Whenever any document is added to the library, new document symbol in green color is appearing behind the document. We can Remove that option using STSADM Commancd.

 stsadm -o setproperty -pn days-to-show-new-icon -pv 0 -url [Your Virtual Server's URL] 

Ex: stsadm -o setproperty -pn days-to-show-new-icon -pv 42 


http://technet.microsoft.com/en-us/library/cc287681%28office.12%29.aspx


How To Hide The Add Document Or Add New Item

This is a simple workaround and I saw a request a couple days back asking to hide the Add Document link after the list of items. In fact, the Add Document may encourage users to upload files from their computers rather than use the create new (select content type). Plus, you still have the upload document or multiple documents from the ribbon.
There are a few ways to do that, one of which is using the browser only – add a CEWP and hide the link using CSS (see this thread for more). A similar approach is to use JQuery and hide the cell that has the Add Document link (again, you add a CEWP, reference the JQ library and add the script (something like $(document).ready(function() { $(‘#WebPartWPQ2 .ms-addnew’).hide();});). If you are doing this on the All Items view page, you will notice that the document library web part loses focus and you have to click inside to show the Library Tools ribbon and switching between views is not as easy as it should be. This is because we have two web parts in the page (even if you hide the CEWP, which you should any way – just check the Hidden property under Layout). It turns out there is another easy and better way – customize the xslt in SharePoint Designer. Select the library (site objects – lists and libraries) and click the view you want to edit (top right). If you want to modify the number of items per page, do it first: List View Tools – Options – Paging (this is not required but if you do it later you will overwrite your custom view).
Now highlight the text “Add Document” and from Design tab (under list view tools), Actions group, select customize item (click the arrow next to customize xslt). Then, switch to code view. The source view should increase by around 80 lines (starts with <xsl>). Locate the line taht starts with <td class=”ms-addnew” and change its style to display:none
Save your page in SPD and check it back in the browser. The Add Document is no longer visible and the view functions as usual.
Note1: If all you have is a web part, you can also set Toolbar Type to “No Toolbar” in the web part properties and that will remove the Add Document.

Wednesday, February 22, 2012

Use a list in a Web Part on any page in your site

You have proudly created a list with many assorted views. People love it so much they want the list for their sites in the same site collection. Trouble is, it’s not easy to make another list show up on other sites these days. You could use REST (Representational state transfer) or even Web services, but you don’t quite have the skills to do that. Fortunately, there’s another approach that’s much easier. All you have to do is save your list as a Web Part and then add the Web Part to any other page on your site. It’s surprisingly easy to do and doesn’t require any code. In the following example, I’ll assume you are working with a typical customer list.

Part 1: Save the List View to a Web Part file

  1. In the browser, go to the list and display the default view.
  2. To open the list in SharePoint Designer, in the ribbon, on the List tab in the Manage Views group, click the arrow next to Modify View, and then select Modify in SharePoint Designer (advanced).
  3. In SharePoint Designer, position the insertion point on any part of the list.
  4. Do one of the following:
    • If you have contribute permission and want to save the Web Part as a file, in the ribbon, click the Web Part tab, and in the Save Web Part group, click To File, click Save, enter a meaningful Web Part filename, such as Customers.webpart, and then click Save.
    • If you have site-level permissions and want to add the Web Part to the site Web Part gallery, in the ribbon, click the Web Part tab, and in the Save Web Part group, click To Site Gallery, click Save, enter a meaningful Web Part filename, such as Customers, and then click OK.
  5. When SharePoint Designer displays the following message:
  6. Click Yes. This ensures the list is accessible from any site of the current site collection.

Part 2: Add the Web Part to another page
  1. Go to the site you want to add the Customers Web Part to, click Site Actions, click New Page, enter Customers List in the New page name box, and then click Create.
  2. Do one of the following:
    • Add the Web Part from a file
      1. Under the Editing Tools tab group, click the Insert tab, and then in the Web Parts group, click Web Part.
      2. To make the Customers.webpart available to the page for insertion, click the arrow next to Upload a Web Part, click Browse, locate and select the Customers.webpart file created in Step 4 of Part 1, click Open, click Upload.
      3. Under the Editing Tools tab group, click the Insert tab, and then in the Web Parts group, click Web Part.
      4. Under Categories, click the newly created Imported Web Parts folder, under the Web Parts section, select Customers.webpart, and then under the About the Web Part section, click Add.
    • Add the Web Part from the Web Part Gallery
      1. Under the Editing Tools tab group, click the Insert tab, and then in the Web Parts group, click Web Part.
      2. Under Categories, click Miscellaneous folder, under the Web Parts section, select Customers.webpart, and then under the About the Web Part section, click Add.
  3. If you see an Information dialog box, entitled, Message from Web Page, ignore it, and then click OK.
  4. Click the arrow next to the Web Part menu, and then click Edit Web Part.
  5. In the Tool Pane, consider doing the following:
    • If you want a different view than the default view to display, under Selected View, select the view you want.
    • If you want to remove the Add New Item link at the bottom of the list, Under ToolBar Type, click No Toolbar.
    • If you want the List View Web Part to look like a regular list, In the Appearance section, under Chrome Type, click None.
  6. Click OK.
  7. In the ribbon, click the Page tab, and then click Save & Close.  

CSS to change the Header of WebParts in SharePoint 2010

Describes how to customize a standard Web Part in SharePoint by using SharePoint Designer 2010. Depending of the look and feel such as accessibility, performance or cross browser stability it could be a challenge to bend the web part UI exactly in the way you want. The markup of the web parts in SharePoint contains quite a deep nested table structure and the elements do not always have an id or class. 

Download the images and put them into Images library or change the path in the CSS below if you want to put the images in some other folder.

/* WebPart headers */

02 /* All tdS in the row */

03 .ms-WPHeader > TD{ 

04 background-image: url('/Style Library/BlogBranding/Images/WP-MidGreen.png'); 

05 background-repeat:repeat-x;  

06 padding-left:1px; padding-right:1px; height:33px; 

07 border-bottom-style:none!important;border-bottom-color:inherit!important; border-bottom-width:0px!important; 

08 } 

09 /* Left cell */

10 .ms-WPHeader td:first-child { 

11 width:5px; 

12 background-image:url('/Style Library/BlogBranding/Images/WP-LeftGreen.png')!important; 

13 background-repeat:no-repeat; 

14 } 

15 /* Right cell */

16 .ms-wpTdSpace { 

17 width:7px; 

18 background-image:url('/Style Library/BlogBranding/Images/WP-RightGreen.png')!important; 

19 background-repeat:no-repeat; 

20 background-color:transparent; 

21 } 

22 /* Arrow */

23 .ms-WPHeaderTdMenu{ 

24 background-color:transparent; 

25 border:0px!important; 

26 } 

27 /* Web part title */

28 .ms-WPTitle { 

29 padding-left:10px; 

30 font-family:Arial, Helvetica, sans-serif; 

31 color:#fff; 

32 font-weight:bold; 

33 margin-bottom:1px; 

34 font-size:14px; 

35 } 

36 /* linked title and visited */

37 .ms-WPTitle a, .ms-WPTitle a:visited { 

38 color:#fff; 

39 text-decoration:none; 

40 } 

41 /* hover title */

42 .ms-WPTitle a:hover { 

43 color:#333; 

44 text-decoration:none; 

45 } 

46 /* hover web part menu */

47 .ms-WPHeaderTdMenu:hover{ 

48 border-left:1px solid transparent; 

49 background-image: url('/Style Library/BlogBranding/Images/WP-MidGreen.png'); 

50 }
 

Wednesday, February 15, 2012

Removing "Download a Copy" context menu from a Document Library in MOSS2007

 SharePoint 2007 (MOSS/WSS) - how to remove "Download a Copy" context menu from a Document Library

http://blogs.msdn.com/b/pranab/archive/2008/12/06/sharepoint-2007-moss-wss-how-to-remove-download-a-copy-context-menu-from-a-document-library.aspx



SharePoint 2010:

Here is what I did:
1. Added a Content Editor webpart to the AllItems.aspx page
2. Added following HTML into the HTML source of CEWP.

<style>
A[id$='Ribbon.Documents.Copies.Download-Large'] {
    DISPLAY: none
}</style>

Adding and Removing a Button from the Server Ribbon

Please follow the link to Add/Remove Buttons from the Server Ribbon.

http://msdn.microsoft.com/en-us/library/ff408060.aspx#2


Friday, February 3, 2012

HTTP 500 (Service Unavailable) Could not load all ISAPI filters for site/service. Therefore startup aborted

I have migrated MOSS 2007 Environment from 32bit to 64bit. After running the Sharepoint products and technologies configuration wizard successfully, the central administration site page opens up.
( We were installing MOSS 2007 on 64 bit machine)

But in my case it was giving the following error “Service Unavailable”
Checking into event log gave the following information
<!--[if gte mso 9]> Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 <![endif]--><!--[if gte mso 9]> <![endif]--> <!--[endif]-->Could not load all ISAPI filters for site/service. Therefore startup aborted.

and

<!--[if gte mso 9]> Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 <![endif]--><!--[if gte mso 9]> <![endif]--> <!--[endif]-->

ISAPI Filter ‘C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

Searching for it the solution that I found was the following

// Disabling the 32bit mode for your web site.

cscript C:\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
and then the following

// Registering ASP.NET 2.0 as the default framework for that web site

C:\Windows\Microsoft.NET\Framework64\v2.0.50727> 
aspnet_regiis.exe -i