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

Forums / Designing with Sitefinity / Placing Sitefinity controls in Master Pages

Placing Sitefinity controls in Master Pages

7 posts, 0 answered
  1. Rama Krishna
    Rama Krishna avatar
    14 posts
    Registered:
    20 Nov 2008
    11 Feb 2009
    Link to this post

    Hi,

    I am planning to use nested master pages for our second Sitefinity project. I want to place some of the common Sitefinity controls in first level master page. 

    How can I know about html syntax of each Sitefinity control and the namespaces to include in master page code behind? Can you provide any example URL or sample code?

    Thanks in advance.

    RK.

  2. Jeff
    Jeff avatar
    27 posts
    Registered:
    18 Jun 2008
    11 Feb 2009
    Link to this post
    If you're wanting to drag and drop their controls onto your master pages you can always add an asp:ContentPlaceHolder to your master page. That will allow you to drop controls directly onto the template from within Sitefinity wherever you want the content zone to appear.

    <asp:ContentPlaceHolder ID="MyNewContentZone" runat="server">
    </asp:ContentPlaceHolder>

    If you're looking to simply edit the master page in your favorite developer tool, all of their controls are registered in the telerik tag prefix. This has been defined in the web.config file, so the controls are already registered globally within your website.

    <div>
        <telerik:RadComboBox ID="MyRadComboBox" runat="server">
            <Items>
                <telerik:RadComboBoxItem Text="Blah" Value="0" />
            </Items>
        </telerik:RadComboBox>
    </div>

    Hope that gives you an idea where to start.
  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    12 Feb 2009
    Link to this post
    Hi Jeff,

    Thank you for your answer!
    Additional to that reply, let us know which controls you need in your master pages, and I will provide you with the necessary details like namespaces and etc that you need to define.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Rama Krishna
    Rama Krishna avatar
    14 posts
    Registered:
    20 Nov 2008
    12 Feb 2009
    Link to this post

    Jeff , Georgi thanks a lot for your replies.  It’s really helping us to move further on our nested master pages approach.

    Georgi, we are going to put following controls in the first level master page.

    1. Dynamic HyperLink 
    2. RadTabstrip
    3. Image
    4. Breadcrumb
    5. Generic Content
    6. RadMenu
    7. News controls

    With warm regards.
                       - RK

  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    16 Feb 2009
    Link to this post
    Hi Rama Krishna,

    Here is the list with the controls, in order you requested them:
    <%@ Register Assembly="Telerik.Cms" Namespace="Telerik.Cms.Web.UI" TagPrefix="sf" %> 
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sf" %> 
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfContent" %> 
    <%@ Register Assembly="Telerik.News" Namespace="Telerik.News.WebControls" TagPrefix="sfNews" %> 

    controls on the master page:
            <sf:DynamicHyperLink ></sf:DynamicHyperLink> 
            <telerik:RadTabStrip></telerik:RadTabStrip> 
            <asp:Image /> 
            <sf:Breadcrumb></sf:Breadcrumb> 
            <sfContent:ContentView></sfContent:ContentView> 
            <telerik:RadMenu></telerik:RadMenu> 
            <sfNews:NewsView ></sfNews:NewsView> 
             

    The rest of the News Controls are defined with tag prefix sfNews.

    I hope this helps.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Rama Krishna
    Rama Krishna avatar
    14 posts
    Registered:
    20 Nov 2008
    16 Feb 2009
    Link to this post

    Hi Georgi,

    Thanks for providing details.

    I tried with RadTabStrip menu control in my Master page. The control is rendering fine while creating template, but it's not allowing me to edit and configure menu properties in Template edit mode.  I believe maintenance wise it’s difficult to assign all required properties manually in Master page.  For example if we want to assign Sitefinity home page to first tab of  TabStrip menu control,  manually we need to set first tab’s NavigateUrl property with  home page url ( i.e. NavigateUrl  = '~/home.aspx' ) in Master page.  Later if there is any change occurs in Home page url again we need to modify Master page to change NavigateURL property with new home page url.

    Can you suggest me if there is any way to modify the Rad controls at Template level those are placed in Master page?

    Regards,
            RK

  7. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    18 Feb 2009
    Link to this post
    Hello Rama Krishna,

    In order for you to be able to Edit control properties, the control has to be part of the CMS. Now, when working with templates there are two cases:
    - Including the controls directly in the masterpage (what you did)
    - Including the controls in the CMS template (from within the CMS, the template uses the masterpage, but is not identical to it

    You would have to use the second apporach in this case, and this is what Jeff suggested in his previous reply to you. If you only include a ContentPlaceHolder in the masterpage, then go to Pages -> Templates and edit the template using the respective masterpage, you will be able to drop a RadTabStrip directly from the Sitefinity toolbox. After that you'll be able to edit the properties of RadTabStrip with the Sitefinity property editor.

    Here's an article discussing the use of templates, what you need is in the second paragraph:
    http://www.sitefinity.com/help/developer-manual/working-with-templates.html

    Sincerely yours,
    Slavo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
7 posts, 0 answered