SharePointAds TextOnly

Saturday, 29 January 2011

Change Sharepoint site home page to Sub-site page

Sharepoint 2010 has given top ribbon from where you can change any sharepoint page as home page for current site by "Make this page as Home page"


But there is one limitation, you cannot assign sub site pages as top site home page.

Then how could you do this change? Is there any way to change default home page to the sub-site pages? Even you cannot change default home page from IIS.

I googled for this and found another way to change default home page path. You have to change into web.config file of Sharepoint site(you can find web.config by looking at Local_Drive:\Inetpub\wwwroot\port_number or check this blog for more details http://blog-sharepoint.blogspot.com/2009/12/where-is-sharepoint-webconfig.html )

Edit your site web.config file with following lines (under system.web )

<urlMappings enabled="true">

<add url="~/" mappedUrl="/french/Pages/Default.aspx"/>

</urlMappings>



Save above changes to web.config file and reset IIS. And now browse for the site, you will see the changes.

you can change default home page in both Sharepoint 2010 and MOSS 2007.

Thursday, 30 September 2010

SharePoint Manager 2010

The SharePoint Manager 2010 is a SharePoint object model explorer. It enables you to browse every site on the local farm and view every property. It also enables you to change the properties.

Really very useful for SP developers and admins!


You can download Sharepoint Manager 2010 from Codeplex.

Wednesday, 25 August 2010

How to get approvers user name in workflow?

When you assign workflow task to any group and how would you get task approvers user name? Task list can show only 'assigned to' column which will give you group name only.
You can fetch approvers user name by creating custom List item event receiver for task list. Create Item updated event receiver and add following code...

public override void ItemUpdated(SPItemEventProperties properties)
{
base.ItemUpdated(properties);

SPListItem oListItem = properties.ListItem;
oListItem["ApprovedBy1"] = properties.UserDisplayName;
oListItem.Update();
}

*Note: Create new column for workflow task list. I created new column with 'ApprovedBy1' name.

Saturday, 7 August 2010

How to Edit User Profile in Sharepoint 2010?

If You have to modify user profile information from 'People and Groups' option in Sharepoint site then you can't directly edit user profile information. Even on edit user page you will see only non editable data.

User profile information can be change from 2010 central administration site. Follow the steps to modify user profile or user properties.
  1. Login Central Admin site
  2. Click on 'Application Management' option menu from left navigation
  3. In 'Service Application' section, click on 'Manage service applications' link
  4. From this serviceappliction page, click on 'User Profile Service Application' link
  5. And then you can see lots of options for people, synchronization, Organizations, My site settings etc etc,
  6. On same page, under People section click on 'Manage User Profiles' link
  7. find the user and click on User name from below grid, select 'Edit My Profile' option
  8. You can change user profile on edit form.
  9. Click on 'Save and close' button
By default it could take up to some time to reflect the new updated information througout all web applications bound to the user profile service application. A timer job is taking care of this and you could kick this one of to run manually once by going to "Check Job Status" screen in Central Admin (http://site/_admin/Timer.aspx).

Monday, 26 July 2010

Sharepoint : How to Edit List Item's Default forms from UI?

How we can edit Sharepoint's List Item forms( NewForm.aspx, DispForm.aspx or EditForm.aspx) from UI? By default there is not any option in Site Setting tab to edit form.
If you want to edit List Item default forms on UI then there is another way...
Just add below line in URL..
&ToolPaneView=2


After adding this statement in URL, you can edit page or add new web parts on default list items page.

Tuesday, 18 May 2010

Sharepoint 2010: Remove 'All Site Content' and ‘Recycle Bin’ link

You can remove 'All Site Content' and ‘Recycle Bin’ link from sharepoint site by doing some change in master pages. Follow the following steps to remove both links from every pages.
  1. Open ‘v4.master’ file from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL (If you have only MOSS then in \12\TEMPLATE\GLOBAL ) or If you are using your custom master page then edit your custom master page.
  2. Find </head> , above </head> add following code



Save the changes in file. Now it will affect on every

Monday, 3 May 2010

Populate all Sharepoint Document Library names which has my custom Content types

Today I populated all document library names which has my custom content type in drop down list control in web part.
(So before start further, I am assuming that you have created any document library with custom content type in visual studio 2010.)
Lets starts with creating simple web part template in VS 2010 and on user control page (in .ascx) add ASP.net dropdown control with name 'ddlCategory'

<asp:DropDownList ID="ddlCategory" runat="server" > </asp:DropDownList>


and on usercontrol.ascx.cs page, add following function code on 'page_load'


public void PopulateDocNames()
{
ArrayList listWithMyCT = new ArrayList();
using (SPSite objSite = new SPSite("http://YOURSITE:PORT/"))
{
using (SPWeb objWeb = objSite.OpenWeb())
{
foreach (SPList list in objWeb.Lists)
{
if (list is SPDocumentLibrary && list.ContentTypes["Custom_Content_Type"]!= null)
{
listWithMyCT.Add(list.Title);
}
}
}
}
ddlCategory.DataSource = listWithMyCT;
ddlCategory.DataBind();
}

Note: Change YOURSITE:PORT and Custom_Content_Type with your site URL with port and your custom content type name.