I am trying to create a document alias for the CMSMessages/SiteOffline.aspx page through the API by using this method
private bool CreateDocumentAlias()
{
// Get "Home" document
CMS.TreeEngine.TreeNode document = CMS.CMSHelper.TreeHelper.GetDocument(CMSContext.CurrentSiteName, "/CMSMessages/SiteOffline", CultureHelper.GetPreferredCulture(), true, "CMS.MenuItem", false);
if (document != null)
{
// Create new document alias object
CMS.TreeEngine.DocumentAliasInfo newAlias = new CMS.TreeEngine.DocumentAliasInfo();
// Set the properties
newAlias.AliasURLPath = "/SiteOffline";
newAlias.AliasNodeID = document.NodeID;
newAlias.AliasSiteID = CMSContext.CurrentSiteID;
// Save the document alias
CMS.TreeEngine.DocumentAliasInfoProvider.SetDocumentAliasInfo(newAlias, CMSContext.CurrentSiteName);
return true;
}
The problem is that I have no idea what the class name would be (the 'CMS.MenuItem' part). I've tried getting to the information by looking at the CMS.CMSHelper.CMSContext.CurrentPageInfo.ClassName.ToString(); but it always returns that the CurrentPageInfo is null.
Any suggestions on how to do this would be greatly appreciated!