Thanks to the pointer from Helena I was able to retrieve the data I was after. Ithink I've got this right with the following code:
#region private void GetPageData()
private void GetPageData()
{
UserInfo ui = UserInfoProvider.GetUserInfo(CMSContext.CurrentUser.UserName);
CMS.TreeEngine.TreeProvider tree = new TreeProvider(ui);
CMS.TreeEngine.TreeNode node = tree.SelectSingleNode(
CMSContext.CurrentSite.SiteName,
CMSContext.CurrentDocument.NodeAliasPath,
CMSContext.CurrentDocument.DocumentCulture);
if (node != null)
{
if (node.DocumentContent.EditableWebParts[targetWebPartName] == null)
{
pageTitle = this.Page.Title;
}
else
{
pageTitle = (string)node.DocumentContent.EditableWebParts[targetWebPartName];
}
}
else
{
pageTitle = this.Page.Title;
}
pageUrl = Request.Url.Scheme + "://" + Request.Url.Host + URLRewriter.CurrentURL;
}
#endregion
Many thanks for the support Tony, Sean and Helena. This is my first attempt at working with Kentico CMS and your responses are very much appreciated.
Also, if there's something not quite right in the code above, please let me know.
Regards,
Lee