In MOSS2007 I need to find and remove for example the default content type from a list (in order to be replaced by a custom one). The list can be on multiple sites, the sites can be in multiple languages and the name for this content type can be diffrent (ex: "Wiki Page" in EN, "Wikipagina" in NL etc.) My ideea was to find the content type using the Id or the prefix of Id (for ex: wiki page start always with 0x010108). Is there any better ideea ? Can we get in code the name of contentypes depending of the language ?
private static SPContentType GetWikiPageContentTypeFromList(SPList list)
{
string wikiPageStartId = "0x010108";
foreach (SPContentType contentType in list.ContentTypes)
{
string ctId = contentType.Id.ToString();
if (ctId.StartsWith(wikiPageStartId))
{
return contentType;
}
}
return null;
}