ZachW
-
7/2/2013 7:52:52 AM
Inheriting WebPart from Parent Node
Just upgraded from 5.5 r2 to 6. I have 2 pages on my site that use ASPX templates. In my root node, I have one editabletext webpart that I need to inherit to the ASPX pages. I had it in place with 5.5r2 but the it seems the upgrade has a different GetPageInfo method that caused my custom solution to break. After searching, I found this article which looks like what I want to do, but it doesn't work.
http://devnet.kentico.com/Knowledge-Base/Content-Management/How-to-inherit-editable-region-content-when-using.aspx
My end goal is that the user can modify and editabletext region in the root node and it will appear on every single page including the aspx pages. Right now it only appears on portal pages. I followed the tutorial above so this is my current code...
In aspx masterpage:
<cms:CMSEditableRegion runat="server" ID="editabletext" RegionType="HtmlEditor" RegionTitle="" InheritContent="true" /> <asp:PlaceHolder runat="server" ID="plcContent"> <asp:Literal ID="ltlRegion" runat="server" Visible="false"/> </asp:PlaceHolder>
In aspx masterpage.cs:
CMS.PortalEngine.PageInfo parentpi = CMS.PortalEngine.PageInfoProvider.GetPageInfo(CMS.CMSHelper.CMSContext.CurrentSiteName, "", CMS.CMSHelper.CMSContext.CurrentDocumentCulture.CultureCode, "", CMS.CMSHelper.CMSContext.CurrentPageInfo.NodeParentId, false); // Show label for editable region content this.ltlRegion.Visible = true; // Hide editale region control this.editabletext.Visible = false; this.ltlRegion.Text = CMS.GlobalHelper.ValidationHelper.GetString(parentpi.EditableRegions["editabletext"], ""); this.ltlRegion.Text = parentpi.EditableRegions.Count.ToString(); CMS.ExtendedControls.ControlsHelper.ResolveDynamicControls(this.plcContent);
I believe the problem is that it's returning 0 for the parentpi.EditableRegions.Count. Am I setting my parentpi wrong?
|