Thursday 10 November 2011

Replace or change "Search this site…" text in SharePoint 2010

Described below is a simple fix to replace “Search this site…” text within the search box in SharePoint 2010 site.

First of all locate these 2 folders –
  1. %14Hive%\Template\Features\OSearchBasicFeature
  2. %14 Hive%\Template\Features\OSearchEnhancedFeature
Now go to first folder, before proceeding take a backup of "SearchArea.xml", and then open the file in Notepad or SharePoint Designer 2010. Add the below property –

<Property Name="QueryPromptString">Some Text</Property>

In the property above, replace “Some Text” with the required text, in my case I have replaced this with “Keyword”. Repeat the above steps for "SearchArea.xml" file in second folder as well. Now after iisreset you will get the desired result.


Note: Only after changes in both the folders and iisreset you will get the result.

===========================================================

Thursday 3 November 2011

Delete Extended Web Application in SharePoint 2010

  1. Start Central Administration
  2. Go to Application Management
  3. Select the Web Application from which the site(to be deleted) was extended from.


  4. Click Remove SharePoint from IIS Web Site (as shown above)
  5. Select the extension (zone) to be deleted


  6. Select Yes to delete the IIS Web site.


  7. Finally click OK and you are done !!

====================================================

Wednesday 2 November 2011

Text Captcha with InfoPath form in SharePoint 2010

For past few days I have been searching blogs/forums to find a way to use Text Captcha with InfoPath form, but in vain. I have a created a simple Text Captcha functionality in InfoPath form and penning it down here, so that somebody outside there will face less pain than me.  

To start with, create a new InfoPath form in InfoPath Designer 2010. Change the color of the Text Box and make it Read-only, which will hold the Captcha text. We call it “Security Check” Text Box.




In Text Box Properties of “Security Check”, set the Default Value as the below formula.




This formula will generate a new number each time the page is loaded --
substring(string(number(concat(number(substring(substring-after(string(now()), "T"), 7, 2)) * 3 + 31, number(substring(substring-after(string(now()), "T"), 7, 2)) * 5 + 17, number(substring(substring-after(string(now()), "T"), 7, 2)) * 9 + 37))), 2, 5)

Now go to “Manage Rule” for “Enter the numbers shown” Text Box, as shown below.


In Rules window, click on Condition and add the below condition. The condition states that Captcha-Text should not be equal to Entered-Text. Click “OK” and enter "ScreenTip" in Rules window on right side.



Now publish the page and see the result. It will display a page with a Text-Captcha.


On entering incorrect value, it display screen tip and will not proceed further.



On entering correct value, the data is submitted.


==========================================



Monday 19 September 2011

Enable Anonymous access for SharePoint 2010 site

To enable Anonymous access in SharePoint 2010, first go to Central Administration >> Application Management >> Manage Web Application

On this screen, select the web application for which you want to enable anonymous access and click on Authentication Providers option.


This will open a small window, here click on Default link.


After clicking default, you will see Enable anonymous access checkbox. Click the checkbox to make it enable.


Now go to Site Settings, and click on Site Permission. This will open the below screen with anonymous Access option. Click Anonymous Access option.



Now, you will see the options are enabled which were previously disabled.


Select ‘Entire web site’ or ‘Lists and Libraries’ to enable anonymous access as per your requirement.


Friday 16 September 2011

Content Query Web Part (CQWP) not showing all columns for filtering

After adding a CQWP on my page and specifying a source, I tried to select metadata columns; however I could not find those in the dropdown. Metadata columns were somehow not listed in the dropdown. I followed below steps to get all the columns listed in the dropdown for selection –

1. Export the CQWP.



2. After exporting CQWP, open it with a notepad and search for the below line –

      <property name="CommonViewFields" type="string"/>

3. Replace this line with below  text–

<property name="CommonViewFields" type="string">
ExternalUrl,URL;PublishingPageImage,Image;Body,Description;PublishingPageContent,RichHTML;PublishedDate,   DateTime;Author, User;
</property>

Save and import the modified web part. Add this modified CQWP to your page and voila, now you can see all the fields in the dropdown for selection.


Thursday 15 September 2011

New Site page not showing all Site Templates in SharePoint 2010

After creating a publishing site, when I tried to create a new blog site, I realized that all the site templates were not appearing under ‘New Site’ option. By default only 2 templates were appearing.  


 
After spending some time exploring I could find a way out. Follow the below steps to get all the site templates in SharePoint 2010.

  1. Go to Site Settings >> Look and Feel >> Page Layouts and site templates

  
  1. By default only 2 templates are selected. Go ahead and select the required ones. 

Now after selecting, when you go to ‘New Site’ page, you will see all the selected Site Template. This page can be used to select Site templates as well as Page Layouts.

Friday 17 June 2011

Failed to start the database service MSSQL$OfficeServers. Repair this product by selecting it from the Add/Remove Programs menu.

After installing SharePoint when I tried running ‘SharePoint Products and Technologies Configuration Wizard’, it gave below error --

======================================================================
Failed to start the database service MSSQL$OfficeServers.  Repair this product by selecting it from the Add/Remove Programs menu. 
======================================================================

I tried reinstalling everything again but in vain. Finally after doing some research got a quick fix.

Solution:
Go to START -> RUN -> REGEDIT
Then locate this folder (HKLM/Software/Microsoft/Shared Tools/Web Server Extensions/12.0/WSS) and change ServerRole key from ‘SingleServer’ to ‘Application’.

Monday 6 June 2011

Redirection to Login Page issue in SharePoint

This is my first blog and it may be useful to somebody and save their time, as we struggled a lot to figure out why some of our SharePoint pages were redirected to login page for anonymous users. Only at the time of testing we came to know that if we are logged-in (non-anonymous) and browse a page (which is checked-out) it shows up properly, and when we access the page as anonymous user we were redirected to login page. In spite of our site been enabled for anonymous users, we were facing this issue.  The behavior was such because we used ‘+’ (plus) special character in the URL in order to make our site SEO compliant. When we replaced ‘+’ with ‘-‘ in all the URLs (keeping it SEO compliant) and checked, the problem was resolved and it gave us a sigh of relief.