Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Hiding Breadcrumb on home page

  1. #1
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default Hiding Breadcrumb on home page

    We often get asked: "how can I hide the breadcrumb on the home page".

    it's often not needed there, as it would only say "Home", so here is one way to do it. There are other ways of course, but this way demonstrates how you can tie into the control structure of the skin, by using runat="server" and understanding that the code behind for a skin is /app_code/templatebase.cs

    So, first, change your skin to add runat=server around the breadcrumb:

    Code:
    	        <div runat="server" id="breadcrumb">Now In: (!SECTION_TITLE!)</div>
    then add this to templatebase.cs at the end of the Page_Load event

    Code:
                if(AppLogic.AppConfigBool("HideBreadcrumbOnHomePage") && CommonLogic.GetThisPageName(false).ToLowerInvariant() == "default.aspx")
                {
                    System.Web.UI.HtmlControls.HtmlContainerControl bcrumb = (HtmlContainerControl)Page.FindControl("breadcrumb");
                    if (bcrumb != null)
                    {
                        bcrumb.Visible = false;
                    }
                }
    We made it appconfig controlled also, but you don't have to. That's it, Set that appconfig true, and it now hides the breadcrumb on the home page. No need to make a separate template for the home page now just to hide the breadcrumb.

    Hope this tip is helpful.
    Last edited by Rob; 08-11-2007 at 07:59 PM.

  2. #2
    whiteonrice04 is offline Junior Member
    Join Date
    Nov 2010
    Posts
    1

    Default

    How is this done in v9?