SF 3.7 to SF 5.0 Code Conversion
Hi I was just wondering if someone could point me in the write direction to help me convert these 2 short blocks of code from 3.7 to 5.0
thank you in advance.
1)
try
Telerik.Cms.CmsManager cmsManager =
new
Telerik.Cms.CmsManager();
// get the current node of sitemap
Telerik.Cms.Web.CmsSiteMapNode currentNode = (Telerik.Cms.Web.CmsSiteMapNode)SiteMap.CurrentNode;
// get the CmsPage represented by the current node and extract its ID
Telerik.Cms.ICmsPage currentPage = currentNode.CmsPage;
Guid currentPageId = currentPage.ID;
hlink.NavigateUrl =
"~/loadpages.aspx?guid="
+ currentPageId.ToString();
hLinkWhole.NavigateUrl =
"~/loadpages.aspx?guid="
+ ParentPageGUID;
// currentPageId.ToString();
//Telerik.Cms.Web.CmsSiteMapNode siteNode = (Telerik.Cms.Web.CmsSiteMapNode)SiteMap.Provider.CurrentNode;
//Response.Write(siteNode.RootNode.Title + ": " +siteNode.ParentNode.Title + ":" + siteNode.Title);
catch
(Exception ex)
protected
void
Page_Load(
object
sender, EventArgs e)
try
Telerik.Cms.CmsManager cmsManager =
new
Telerik.Cms.CmsManager();
// get the current node of sitemap
Telerik.Cms.Web.CmsSiteMapNode currentNode = (Telerik.Cms.Web.CmsSiteMapNode)SiteMap.CurrentNode;
// get the CmsPage represented by the current node and extract its ID
Telerik.Cms.ICmsPage currentPage = currentNode.CmsPage;
Rev.Text += currentPage.Version.ToString();
lbUpdated.Text += currentPage.DateModified.ToShortDateString();
catch
(Exception ex)
Hello,
Generally the only thing you'll need to convert the below code would be getting the current PageSiteNode, please correct me if the desired use case scenario is different. You can achieve this functionality by using SiteMapBase like this:
var currentNode = SiteMapBase.GetActualCurrentNode();
var currentNodeId = currentNode.Id;