BreadCrumbs & PageTitle controls

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
11/20/2010 6:01:36 PM
Gravatar
Total Posts 156

BreadCrumbs & PageTitle controls

Could somebody please elaborate on BreadCrumbs attributes and how they work?  I thought they were self-explanatory, but I'm not getting expected results.  Looking at the code, these are the public properties and my assumptions/conclusions:

        public string WrapperCssClass  -  this makes sense

        public bool ForceShowBreadcrumbs - this forces bread crumbs on all pages

        public bool UsePageCrumbOnly -  setting this to true or false didn't do anything 

        public bool UseTopParentCrumbOnly - assumed that only top pages  would be shown, yet when go to 2nd and 3rd level pages, all levels are displayed in the bread crumbs

        public bool SuppresIfCurrentPageIsParent -  not quite sure what this does

        public bool ForceShowChildPageBreadCrumbs - setting to true/false didn't do anything.

        public string AddedCrumbs - no idea what this is

        public string CssClass - didn't test this .. don't know.

        public string CurrentPageCssClass - setting custom css class for the current control

        public string Separator - defining separating string

        public bool ShowHome - show/hide home .  Setting this to false didn't help - Home was still shown on Search results, site map, and loging/recoving pages.

 

Here's what I'm trying to accomplish:  I have three levels of pages.

I want the breadcrumbs to be displayed on all pages with only the first two levels visible.  The first and second levels should each have their own styling, no separator string in between.

I don't want the Home link to be visible at all, regardless of the page on the site.

 

 

 

 

 

 

11/22/2010 7:48:16 AM
Gravatar
Total Posts 18439

Re: BreadCrumbs & PageTitle controls

Those properties are not meant to be set declaratively from the layout.master file, they are set programmatically from code according to page settings.

It is not currently possible to style the breadcrumb links different according to their depth, you can enable them or not on any page at any level but you cannot make it only show certain levels or show some levels different from others other than creative css solutions that may exist.

ForceShowBreadCrumbs is not for making it show them on all pages and is not used in cms pages but in edit pages that are related to cms page features. Like in webstore for example, if you click the Store Manager link it goes to an edit page and this property is used to show the breadcrumbs while on the edit page regardless of whether the related cms page has bread crumbs enabled. Then if you click further on the Store Settings you will seeon that page it appends an additional bread crumb for the main store manager page, this is done with the AddedCrumbs property like in this code example from WebStore/AdminStoreSettings.aspx.cs:

Control c = Master.FindControl("Breadcrumbs");
            if ((c != null)&&(store != null))
            {
                BreadcrumbsControl crumbs = (BreadcrumbsControl)c;
                crumbs.ForceShowBreadcrumbs = true;
                crumbs.AddedCrumbs
                    = "<a href='" + SiteRoot
                    + "/WebStore/AdminDashboard.aspx?pageid="
+ pageId.ToInvariantString()
+ "&amp;mid=" + moduleId.ToInvariantString()
+ "' class='unselectedcrumb'>" + WebStoreResources.StoreManagerLink
+ "</a>";

11/22/2010 11:31:19 PM
Gravatar
Total Posts 156

Re: BreadCrumbs & PageTitle controls

Got it - thank you, Joe. I guess I should have examined the code a little closer - I've gotten used to quickly glancing at public properties for control go get an idea of what I can do with it.

So I guess I have to point to a custom layout.Master.cs file in order to programmatically set these kinds of titles here. I guess I could just use JQuery to do that, but I'd much rather do it on the server side as the page is rendered.

Any way to enable titles on SearchResults.aspx, Login.aspx, RecoverPassword.aspx, and SiteMap.aspx ?  <porta: PageTitle> control doesn't work on those.  It's not really suitable for me on other pages as well thought because on 3rd level pages ,I actually want to display 2nd level titles.

11/23/2010 8:51:50 AM
Gravatar
Total Posts 18439

Re: BreadCrumbs & PageTitle controls

<portal:PageTitle is really a legacy control that was once used in the head  section of layout.master long long ago in the 1.1 framework version of mojoPortal. Joe Davis has used it for a way to show the page title outside of the <title> which only shows in the browser title bar, so I ahve kept it around.

Unfortunately that control only works in the context of a cms page where it gets the page title from the currentPage object, but pages like login and register, search, sitemap, etc are not cms pages so the only place the title exists is in the <title> tag in the head of the document. The only solution that comes to mind is to make some little javascript widget that reads the document.title and displays it in page markup and use that in layout.master.

I don't have any suggestion for displaying parent page titles on child pages.

You must sign in to post in the forums. This thread is closed to new posts.