+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Nested Master Page Issues

Nested Master Page Issues

10 posts, 0 answered
  1. Will
    Will avatar
    26 posts
    Registered:
    19 Aug 2008
    28 Jul 2009
    Link to this post
    I posted this in a different forum, but it really is more fo a bug than a design issue.

    We have an existing site to which we are adding Sitefinity, and we have run into some issues relating to nested master pages.  We have the following issues:

    1. If there is a ContentPlaceHolder in a child master page with the same name of one in the parent master page, attempting to save, change Edit Modes, or add any controls while editing the Template of the child master page will fail with a duplicate name error.  I have temporarily changed the names to work around this issue.

    2. ContentPlaceHolder controls in child master pages that reference a ContentPlaceHolder control in the parent master page that is inside the <head> element of the <html> document, causes a viewstate error when editing the Template of the child master page.  If finally discovered the work-around below:

    <asp:Content ID="Content1" ContentPlaceHolderID="SiteHead" runat="server">  
        <asp:ContentPlaceHolder ID="head" runat="server"><!-- Content placeholder for SearchMaster head --></asp:ContentPlaceHolder> 
    </asp:Content> 
     

    3. ContentPlaceHolder controls in the <head> section of the <html> document on a master page, causes the Template Editor to render poorly as it attempts to display a section for this control that is off page.  For us, it tries to render the editor box for this in the upper left hand corner of the page, but its only about 10 pixels wide.  If I max the browser window to full screen (1920x1200) the area is much larger, but the Edit Mode and Theme controls are messed up or not visible.

    Here is the message from the viewstate error:

    Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

    On another note, we use the styleSheetTheme and/or theme attributes of the pages element in the web.config to define the default theme, but we were forced to set both to "" in the ~/Sitefinity/web.config as it caused those pages to render incorrectly.  While it fixed the Sitefinity pages, it causes our Templates/Pages to render incorrectly unless we specify a theme in the editor.  Since this must be dynamic and controlled by our code, I need to know what setting a theme actually does.  FYI, we use styleSheetTheme more often than the theme attribute.

    Thanks,
    Bill
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    31 Jul 2009
    Link to this post
    Hello Bill,

    If I should be honest, most of the issues you counted through are known to our team. We are doing our best to improve the administration area for the next version. We would probably improve the nested master page support natively.

    I apologize for the inconvenience.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    06 May 2010
    Link to this post
    I think I have an issue that can be related to Mr. Bill's issue.

    I'm using nested master pages also so naturally I use <asp:ContentPlaceHolder> tags to connect the two master pages. So for example, MasterPage1 which is the parent has an <asp:ContentPlaceHolder> tag to house the contents of MasterPage2 which is the child. Of course the contents of MasterPage2 are wrapped around an <asp:Content> tag that references the <asp:ContentPlaceHolder> tag of MasterPage1. This <asp:Content> tag further contains ContentPlaceHolder tags that are meant for the widget controls. Now the issue is, the ContentPlaceHolder tag that is located in MasterPage1 seems to be generating an extra content holder for the widgets when I create a template using MasterPage2, it is kinda annoying. We'll have this CMS used by non-tech people and we fear that if such extra content boxes exist, it might be confusing.

    Hope this could be clarified. Thank you! :)
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    07 May 2010
    Link to this post
    Hi Jan Kenneth Regala,

    Thank you for joining the conversation.

    As Georgi has outlined this issue is by default. You can try to "close" the content placeholders so that they are not edited in the CMS by adding some dummy content - a label with no text or something like this. We are going to provide a better support for nested master pages in our next major version, these issues should not be present there.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    12 May 2010
    Link to this post
    Hello I tried adding dummy content (a label with no text) but to no avail, the annoying extra widget box still appears.

    Done this with Sitefinity 4.0 beta version installed on my PC, which I think is supposed to be the trial for your next major version am I correct? Or not?

    Thanks :)
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 May 2010
    Link to this post
    Hi jkregala,

    The Sitefinity 4.0 CTP is just a preview, it is not feature complete so we cannot guarantee that what you have tried there will work. What I have suggested is for Sitefinity 3.x versions. The actual beta which will have most of the planned functionality is still to be released.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    18 Oct 2010
    Link to this post
    Hello Telerik Team, we have migrated some of our sites into Sitefinity 4.0 (BETA 2) and this problem is still present. Any workarounds? Thanks :)
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Oct 2010
    Link to this post
    Hello jkregala,

    Thank you for getting back to us.

    You are correct we still have problems with the nested master pages support. For now the workaround for this is to create parent templates and then create templates which are based on these parent templates without using master page files.

    Can you please see if Visual Studio is creating content place holders in the headers of the master pages. You should not have content place holders in the headers:
    parent master:
    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Parent.master.cs" Inherits="SitefinityWebApp.Parent" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    child master:
    <%@ Master Language="C#" MasterPageFile="~/App_Master/Parent.Master" AutoEventWireup="true" CodeBehind="Child.master.cs" Inherits="SitefinityWebApp.App_Master.Child" %>
     
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    </asp:Content>


    Best wishes,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    19 Oct 2010
    Link to this post
    Thanks for noticing that, it's been causing the extra Control boxes. I have noticed that as long as the contentplaceholder set on the master page will have actual content in the child master page the template/page won't have the extra control boxes. Is this the actual case?
  10. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Oct 2010
    Link to this post
    Hello jkregala,

    Generally you should see as many control boxes as the ones defined in the child master page.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
10 posts, 0 answered