|
||
The following example shows you how to modify website properties using the API:
[C#]
using CMS.CMSHelper; ... // Get current site name (you can use code name of the required site instead) } lblError.Text = "Site cannot be started.<br />Original exception: " + ex.Message; } lblError.Text = "Error when modifying site properties.<br />Original exception: " + ex.Message; } |
The following sample code shows how you can add a new content culture to an existing website:
[C#]
using CMS.SiteProvider;
...
// Get site and culture objects SiteInfo si = SiteInfoProvider.GetSiteInfo("CorporateSite"); CultureInfo ci = CultureInfoProvider.GetCultureInfo("AR-Sa");
// If both exists if ((si != null) && (ci != null)) { // Add culture to site CultureSiteInfoProvider.AddCultureToSite(ci.CultureID, si.SiteID); } |