Sunday, May 31, 2009

Getting Ancestor item based on Template ID

public static Item GetAncestorItemBasedOnTemplateID(Item item)
{
var filter = "";

filter += string.Format("contains('{0}', @@templateid)", item["templates"]);
return item.Axes.SelectSingleItem("ancestor-or-self::*[" + filter + "]");
}

Sunday, May 3, 2009

Getting user from SC6

  1. if(User.Exists(domainUser))
  2.             {
  3.                 var user = User.FromName(domainUser, false);
  4.                 return !string.IsNullOrEmpty(user.Profile.FullName) ? user.Profile.FullName : user.LocalName;
  5.             }

Increasing the allowed Media file size

The following web.config changes, will enable bigger size Media item to be upload.

<httpRuntime maxRequestLength="20480" executionTimeout="600"/>

and 

<setting name="Media.MaxSizeInDatabase" value="20MB"/>

Those changes will increase the allowed file size to 20MB