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

Forums / Developing with Sitefinity / Adding External .aspx Page as Title in Modules

Adding External .aspx Page as Title in Modules

3 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    16 May 2008
    Link to this post
    Hi,

    Could you help me to link one external Admin.aspx Page inside Module's Titles. I lovely integrate one external navigation as Module Title for better service. I have developed external link to go inside Dashboard but not the return from SF. Many thanks for help. 
    Regards



     
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    19 May 2008
    Link to this post
    Hello Pierre,

    1) Create a new AdminPage in the ~/Sitefinity/Admin folder, e.g. Databases.aspx.

        Databases.aspx:
    <%@ Page Language="C#" MasterPageFile="~/Sitefinity/Admin/Admin.master" AutoEventWireup="true" CodeFile="Databases.aspx.cs" Inherits="Admin_Databases" Title="Databases" UICulture="auto:en-US" Culture="auto:en-US" %> 
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
        <div id="main">  
            <div class="in">  
                <span style="font-weight:bold;font-size:16px;color:#333;">Under construction</span>           
            </div> 
        </div> 
        <div id="subnav">  
            <div class="in">  
                <ol> 
                    <li><a href="#">Manage Databases</a></li>  
                    <li><a href="#">Manage Maps</a></li>  
                    <li><a href="#">Manage Contacts</a></li>  
                </ol> 
            </div> 
        </div> 
        <div class="clear width"><!-- --></div>  
    </asp:Content> 

        Databases.aspx.cs:
    using System;  
    using System.Data;  
    using System.Configuration;  
    using System.Collections;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
    using Telerik.Cms.Web;  
     
    public partial class Admin_Databases : AdminPage  
    {  
        public override string MenuItemName  
        {  
            get { return "databases"; }  
        }  
    }  
     


    2) Create a .css file for the databases page. The name of the file should be the same as the MenuItemName property of the new created AdminPage, i.e. databases.css. Place it in ~/Sitefinity/Admin/Themes/Default folder:

        ~/Sitefinity/Admin/Themes/Default/databases.css
    @import url(reset.css);  
    @import url(global1.css);  
    #ctl00_wrapDiv {background:#C2CED0 url(Images/globBack.gif) repeat-y;margin:0 10px;min-height:100%;position:relative;_height:100%}  
    #ctl00_wrapDiv #header{height:87px} 

    3) Implement your own DataSourceControl and DataSourceView, which inherit MainMenuDataSource and MainMenuSourceView class and override ExecuteSelect method where you should add the new menu item to the existing collection. You could create ExtMainMenuDataSource.cs file in the ~/App_Code folder:
    using System;  
    using System.Data;  
    using System.Configuration;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
    using Telerik.Cms.Web.UI;  
    using Telerik.Cms.Web;  
     
    namespace Controls  
    {  
        /// <summary>  
        /// Summary description for ExtMainMenuDataSource  
        /// </summary>  
        public class ExtMainMenuDataSource : MainMenuDataSource  
        {  
            public ExtMainMenuDataSource()  
            {  
            }  
     
            protected override DataSourceView GetView(string viewName)  
            {  
                if (this.sourceView == null)  
                    this.sourceView = new ExtMainMenuSourceView(this, String.Empty);  
                return this.sourceView;  
            }  
     
            private ExtMainMenuSourceView sourceView;  
        }  
     
        public class ExtMainMenuSourceView : MainMenuSourceView  
        {  
     
            public ExtMainMenuSourceView(IDataSource owner, string name)  
                : base(owner, ExtMainMenuSourceView.DefaultViewName)  
            {  
            }  
     
            protected override System.Collections.IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)  
            {  
                DataView view = (DataView)base.ExecuteSelect(arguments);  
                view.Table.Rows.Add(1000, null"TNC Databases", UrlHelper.ResolveLanguageUrl("~/Sitefinity/Admin/Databases.aspx"), "mnu_databases");  
     
                return view;  
            }  
     
            public static string DefaultViewName = "ExtMainMenuView";  
        }  

    4) Modify ~/Sitefinity/Admin/Admin.master to change DataSourceControl object:
    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Admin.master.cs" Inherits="Admin_Admin" %> 
    <%@ Register Assembly="Telerik.Cms" Namespace="Telerik.Cms.Web" TagPrefix="sf1" %> 
    <%@ Register Assembly="Telerik.Cms" Namespace="Telerik.Cms.Web.UI" TagPrefix="sf2" %> 
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sfWeb" %> 
    <%@ Register Assembly="Telerik.Localization" Namespace="Telerik.Localization.WebControls" TagPrefix="sf3" %> 
    <%@ Register Assembly="RadTabStrip.Net2" Namespace="Telerik.WebControls" TagPrefix="radTS" %> 
    <%@ Register Assembly="RadSplitter.Net2" Namespace="Telerik.WebControls" TagPrefix="cc1" %> 
    <%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rada" %> 
    <%@ Register Namespace="Controls" TagPrefix="app" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head id="Head1" runat="server">  
        <title>Sitefinity 3.0</title> 
        <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    </head> 
    <body> 
        <form id="form1" runat="server" style="height:100%;">  
            <!--<sfWeb:HelpAssistant Visible="false" ID="helpAssistant" runat="server" XmlPath="~/Sitefinity/Admin/Help/PublishBlog.xml" TemplatePath="~/Sitefinity/Admin/ControlTemplates/WebUIControls/HelpAssistant.ascx" />--> 
            <href="#main" id="skip">Skip to the main content</a> 
            <div runat="server" id="wrapDiv">  
                <div id="header">  
                    <div class="topBar">                  
                        <h1 id="projectName" runat="server" class="projectName"><asp:Label id="projectLabel" runat="server" Text="<%$ Resources:ProjectLabel %>"></asp:Label></h1>  
                        <ul class="userInfo">                         
                            <li id="userName" class="userName" runat="server"><asp:Label id="userLabel" runat="server" Text="<%$ Resources:UserLabel %>"></asp:Label>&nbsp;</li> 
                            <li>&nbsp;|&nbsp;<asp:HyperLink ID="profileLink" ToolTip="Change your profile" Text="<%$ Resources:MyProfile %>" NavigateUrl="~/Sitefinity/Admin/CmsAdmin/MyProfile.aspx" runat="server"></asp:HyperLink></li>  
                            <li>&nbsp;|&nbsp;<asp:LinkButton ID="logoutButton" CausesValidation="false" OnClick="logoutButton_Click" ToolTip="<%$ Resources:Logout %>" Text="<%$ Resources:Logout %>" runat="server"></asp:LinkButton></li>  
                            <li id="langList" runat="server" class="langPick">  
                                <sf3:LanguageBar ID="LangBar" runat="server">  
                                    <LayoutTemplate> 
                                        <asp:DropDownList ID="languageList" runat="server"></asp:DropDownList> 
                                    </LayoutTemplate> 
                                </sf3:LanguageBar> 
                            </li> 
                        </ul> 
                    </div> 
                      
                    <div class="tabstripWrapper">  
                        <radts:radtabstrip id="MainMenu" SkinsPath="~/Sitefinity/Admin/Themes/Default/Skins/Tabstrip" Skin="Sitefinity" runat="server" meta:resourcekey="RadTabStrip1Resource1" DataFieldID="ID" DataFieldParentID="ParentID" DataNavigateUrlField="NavigateUrl" DataSourceID="MainMenuDataSource1" DataTextField="Text" DataValueField="Value" OnDataBound="MainMenu_DataBound" CausesValidation="false"></radts:radtabstrip> 
                        <app:ExtMainMenuDataSource id="MainMenuDataSource1" runat="server"></app:ExtMainMenuDataSource> 
                    </div> 
                </div> 
                <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"></asp:contentplaceholder>             
            </div> 
        </form> 
    </body> 
    </html> 

    Hope this helps.

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    19 May 2008
    Link to this post
    Hi,

    Wonderfull, Many thanks for this. Romi
Register for webinar
3 posts, 0 answered