IE Developer Toolbar Not Functioning !

I received this question several times from several colleagues who use IE Developer toolbar for skinning SharePoint sites :
“I installed the IE Developer Toolbar but All the menus are in gray and it’s not functioning at all.”
Well, It’s easy :
1) Tools –> Internet options –> Security –> Local Intranet –> Custom Level –> Run ActiveX Control or PlugIn (Administrator Approved)
2)Tools –> Internet Options –> Programs –> Manage add-ons –> IE Developer Toolbar BHO –> Enable
3)Tools –> Internet Options –> Advanced –> Enable third party browser-extensions 4)Restart IE

Happy skinning šŸ˜€

We’ll miss you, Patrick.

Patrick Tisseghem, long time SharePoint MVP and co-founder of U2U, a Microsoft Gold Certified Partner, suddenly passed away on September 3rd evening in Gothenburg, Sweden due to heart failure. He is survived by his wife, Linda, and daughters, Anahi and Laura.
On behalf of the SharePoint product group, I offer my deepest condolences to Patrick’s family. Patrick was a leading figure in the SharePoint community, well known for his standing room only presentations at conferences and user group meetings as well as respected for his often sold out in-depth technical training courses.

OWSTIMER ! Memory Leakage

Often the OWSTIMER.EXE process will allocate significant amounts of memory . As more and more memory is allocated to OWSTIMER, less is available for other processes, most notably the Internet Information Server (IIS) web service (W3SVC). If IIS does not have sufficient memory, a serious performance penalty will result. The workaround for this memory leakage to stop and then start the OWSTIMER process. This can be accomplished using the built-in Services application (under Administrative Programs in the Start menu) or via the command line. (The command-line entry is “net stop WSSTimerV3“.) In a large farm deployment, the service will be running on many Web Front Ends ( WFE’s) so the workaround must be performed on all of them.

Hiding SharePoint Site Templates & Adding new categories!

A colleague asked me about removing some of the templates/site definitions that are available when creating SharePoint sites. Actually It’s so simple.
To hide a template from users :

1) Open the Webtemp.xml file located in the the 12 hive /template/1033/XML folder.
2) Change the Hidden parameter of the template(s) you want to hide.
3) Run IISRESET

Note also that you can create your own categories by editing the DisplayCategory value

Master Pages Tokens

Hi guys, It’s a little post, but I thought it would be useful for beginners to SharePoint branding.
“Master Pages” is an essesntial topic when it comes to SharePoint Branding as they provide consistency by providing a common layout, content, look and feel across the pages that use them.

Note the reference to the token ~masterurl/default.master in the first line in any sharepoint content page.

When you use the attribut MasterPageFile into your page header, you can give the relative url of the master page you want.
There also some token to give you more options :
Dynamic token :
“~masterurl/default.master”>>> This token references a master page from a content page by using the MasterPageFile attribute together with the value of the MasterUrl property. And this resolves by default to /_catalogs/masterpage/default.master but you can change the MasterUrl property using SharePoint designer or using Master Page page under Site Settings via the browser .
“~masterurl/custom.master”>>> This token references a master page from a content page by using the MasterPageFile attribute with the value of the CustomMasterUrl property . Also it resolves to /_catalogs/masterpage/default.master by default.

MSDN Note : If you subsequently need to delete the default.master file, you must set both of those properties to a different value.
Static token :
“~site/x”>>> This token link to the current site-relative path
“~sitecollection/x”>>> This token link to the current site collection-relative path

For example, if your content page is located atĀ http://myPortal/subsite1/subsite2/default.aspxĀ and you use the token “~sitecollection/mypage.master”, your content page would use the master page athttp://myPortal/mypage.master. If you use the token “~site/mypage.master”, the content page would use the master page located atĀ http://myPortal/subsite1/subsite2/mypage.masterĀ .

Tip : It’s also possible to control the selection of Master Pages at run time with .NET code using the page’s OnPreInit method or by using an HttpModule. ( will be discussed in later posts ) .

Be Careful When Using properties & SPContext

What is SPContext ?
In a nutshell, SPContext object can be used to get a reference to the site or the web from the current context, It Represents the context of an HTTP request in SharePoint .
For instance :
SPList currentList = SPContext.Current.List;
SPWeb currentSite = SPContext.Current.Web;
SPSite currentSiteCollection = SPContext.Current.Site;
SPWebApplication currentWebApplication = SPContext.Current.Site.WebApplication;
SPListItem item = (SPListItem)SPContext.Current.Item;
SPUser user = SPContext.Current.Web.CurrentUser;

What is “Properties” ?
The properties object holds information about an event. You can use it to get references to SPSite, SPWeb, SPList or SPList Item.
for instance :
SPListItem item = properties.ListItem’

However,
Be VERY careful when using properties parameter or SPContext. You CANNOT use the properties command to create your objects or your code will fail! .
You need to use properties or SPContext to locate the items, then use the items IDs to create the object references. You will never get your code to work the way it is above.
You need to get all of the Guid identifiers BEFORE entering the secure block ( RunWithElevatedPriveleges) or Impersonation, then create all the objects you need WITHIN the secure context

Guid SiteId = SPContext.Current.Site.ID;
Guid WebId = SPContext.Current.Web.ID;
Guid ListId = properties.ListId;
Guid UniqueId = properties.ListItem.UniqueId;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site= new SPSite(SiteId))
{
using (SPWeb web= site.AllWebs[WebId])
{
SPList list= web.Lists[ListId];
SPListItem listItem= list.Items[UniqueId];
// Code..
}
}
});

or to impersonate the system account using SPUserToken ( Recommended )

Guid SiteId = SPContext.Current.Site.ID;
Guid WebId = SPContext.Current.Web.ID;
Guid ListId = properties.ListId;
Guid UniqueId = properties.ListItem.UniqueId;
SPUserToken systemAccountToken = SPContext.Current.Site.SystemAccount.UserToken;
using(SPSite mySite = new SPSite(SiteId, systemAccountToken))
{
using (SPWeb myWeb = mySite.OpenWeb(WebId))
{
SPList list= web.Lists[ListId];
SPListItem listItem= list.Items[UniqueId];
// Code..
}
}