Enable search in a document library

Step 1: Go to “Site Actions”, “Site Settings” and under “Site Collection Administration” click on “Search Scopes”.
 
Step 2: Click on “New Scope” and give it a title. Usually the document library you wish to search. Click “OK”
 
Step 3: Now we need to add a rule. Go to the document library you wish to search and grab the URL. Then repeat Step 1 to get back to the search scope settings page. Click on the search scope you created in Step 2. Under the “Rules” section click on “New Rule”. Select “Web Address” and enter the URL of your document library. Click “OK”.
 
Step 4: Click on “New Display Group” and give it a title and a description. In the “Scopes” section select the scope you created in Step 2. The “Default Section” should automatically become the scope you selected.
 
Step 5: Wait for the server to recognize the new scope and display group.
 
Step 6: Go back to the page you wish to add a search box. Go to “Site Actions”, “Edit Page”, click on “Add a Web Part”. Select the “Search Box” web part and click “Add”.
 
Step 7: The page should be in “Edit Mode”. In the “Search Box” web part click on the “edit” button and go to “Modified Shared Web Part”.
 
Step 8: Expand the “Miscellaneous” section. Uncheck “Use site level defaults”. In the “Scope Display Group” sub-section the default display group scope will be “Search Dropdown” change this to the display group you created in Step 4. You cannot browse through the display groups so you will have to type your display group in exactly. Click on “OK”.
 
Step 9: Exit out of “Edit Mode”. Your search box should now have the new search scope you created in Step 2 as the default choice.
 Note:
  •  This must be done at the site collection level or administration level. Also, you must have full control of your site collection.
  •  Test the search. If it does not work you might need to contact the Site Adminstrator to enable your scope and display group or index(crawl) your document library for the search to work.

Change the order of documents in a document library in Sharepoint

Usually, once u upload documents in a document library, they are sorted in ascending order. But if you want them to appear in a particular order, (like a particular document first, another one of ur choice as next… ) follow the below steps:

1. Create a new column called Sort order.

2. Assign a number to each document .

3. Modify your current view to sort documents by the column “Sort Order”

Using a Content Editor Web Part to enforce vertical scrolling on web parts

Using a Content Editor Web Part to enforce vertical scrolling

If you need to do this for a handful of individual web parts, the easiest way is to create a hidden Content Editor Web Part on each page:
  1. Create the initial web part.  By default, it should expand to utilize as much vertical space as it needs. 
  2. Edit the web part as usual.  Under the Appearance category, set the “Height” property to the desired size.Save the changes and view the page.  It will appear just as before, but our desired size will be saved for later.
  3. One piece of information we’ll need to know is the HTML ID of the div containing our web part, which is in the format “WebPartWPQx”, where “x” is a number.  Finding this web part identifier in the page’s HTML allows us to write CSS for a specific section.The easiest way I’ve discovered to find a web part’s ID is to view the page’s source (right-click, View Source) and to search for the string “<span>” followed by the web part’s title.  In our example, we’ll search the page’s source for “<span>Sample Vertical List”, which yields the following:

    This shows the ID of our caption, and its number (6) tells us the ID of the web part we’re looking for (For Example, WebPartWPQ6).  We’ll need this in step 7.

  4. Now, go to edit the page as normal.  On the edit page, select “Add a Web Part”.
  5. Under Miscellaneous, select “Content Editor Web Part”.  This web part allows you to insert pure HTML into the source of a given page.
  6. Modify the shared web part.  From the tool pane, select “Source Editor…”
  7. Enter the required HTML to change the desired web part’s style.  In this case, we’re going to insert a CSS style block to override the default behavior for a given web part.  If our web part has an ID of WebPartWPQ3 (as found in step 3), we’ll add:
  8. <style><!–
    #WebPartWPQ3{
            overflow:auto;
    }
    –></style>

     

    You could alternatively set the property to “scroll” instead of “auto” if you’d like both horizontal and vertical scrollbars to appear regardless of height.

  9. While still editing this web part, set its “Hidden” property to true (found under the Layout category).  This is to prevent users from seeing a “Content Editor Web Part” when viewing the page.  The custom HTML will still function. 
  10. Upon saving your changes, the web part should now display with its fixed height and scrollbar when needed. 
  11. In order to adjust the height, repeat step 2.

This process is probably a bit long for what seems like a simple requirement.  Microsoft should have anticipated users’ needs and manually set the overflow property instead of deferring to the browser’s default behavior.  Hopefully this limitation will be addressed in a future version of SharePoint.

Customize AccessDenied.aspx in MOSS 2007

I got a  requirement to customize the default ‘Access denied page’ in MOSS 2007.

After researching I found the following options available on the net

1.   (http://blogs.msdn.com/sridhara/archive/2007/04/14/customizing-placeholder-values-in-moss-2007.aspx) .

 

2.    Change the ‘Access denied page’ completely as mentioned here (http://blogs.tamtam.nl/mart/CustomizingTheLayoutsFiles.aspx). But this is not MS recommended scenario as future updates may replace the access denied page. Microsoft published a workaround for this (http://support.microsoft.com/kb/944105) but again doesn’t look very clean.  

3.    Create a HTTP module as mentioned here  (http://blogs.msdn.com/bgeoffro/archive/2007/11/12/branding-a-moss-corporate-intranet-portal-part-3-layouts-pages.aspx) .

Google on your Sharepoint site

Found an easy way to have Google Search on your sharepoint site.

  1. Navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE
  2. Create a new folder called “external”
  3. Inside the folder create a single HTML page with the following contents:

    <FORM method=GET action=”http://www.google.com/search
    target=”_blank”>
    <A HREF=”http://www.google.com/” target=”_blank”>
    <IMG SRC=”http://www.google.com/logos/Logo_40wht.gif” border=”0″
    align=”absmiddle”></A>
    <INPUT size=30 maxlength=255 value=””>
    <INPUT VALUE=”Google Search” style=”font-
    size:10″>
    </FORM>

  4. Save the file as “google.htm”
  5. Next drop a Page Viewer Web Part onto your page and point it to the page you created. The url to the page will be http://servername/_layouts/external/google.htm

Sharepoint Development

These links are just for my reference, (and anybody visiting my site),  So I find them easily. All due credit to andrew.

http://andrewmyhre.wordpress.com/2009/01/15/the-sharepoint-development-experience-part-1/

http://andrewmyhre.wordpress.com/2009/01/15/the-sharepoint-development-experience-part-2/