Hi,

I cant figure out how to append the current page title.

I have a menu like this :

- Home
-- Partnership
--- Members
--- Documents 

If i go to Documents page, i have now :
Home -> Partnership

I'd like to have the current page title appended as text (no link) :
Home -> Partnership -> Documents

Is it possible and how to do that?

I've searched for quite a long time now, but didnt found any solution.

Thanks!

Comments

Ludo.R’s picture

Can Custom breadcrumbs do that, or should i use Menu breadcrumb?

MGN’s picture

Status: Active » Postponed (maintainer needs more info)

You'll need to provide more information for any real help.
What kind of pages is "documents"? Is it a view or a node or ???

Ludo.R’s picture

The page types are like this :

- Home (Panel node)
-- Partnership (Page node)
--- Members (View)
--- Documents (Page node)

But i think this shouldn't be dependant on the type of content.

Isn't it possible to have an option "Append current page title"? Don't matter if it is a node, a view or somehting else.

I know i could do it by creating Custom breadcrumbs, but if i have many node types, many views (it's actually the case on this project), several languages, i have to create 10 or 20+ custom breadcrumbs.

And if a top-level page changes (title or nid), i'll have to modify many custom breadcrumbs.

To make short, i think custom breadcrumbs should have the same ability than Menu breadcrumb. Otherwise we have to play along with two modules that may conflict with each other.

MGN’s picture

Category: support » feature
Status: Postponed (maintainer needs more info) » Active

Currently there isn't an option to do this, but I think it can be done. Marking this as a feature request. Thanks for the idea.

Ludo.R’s picture

Understood!

Now i'd have 2 questions :

  • Do you think you could implement this in General settings so that it would work without creating any specific custom breadcrumb (in site building) ?
  • Do you have any idea when this feature would be released with a next version?
    The idea is to get rid of Menu breacrumbs module (even though it is a good module) and only use Custom breadcrumbs which is - i believe - a more powerful module

Thanks!

screenage’s picture

subscribing

MGN’s picture

Good questions.

At first I built it up as on option to append the page title to custom breadcrumbs only. Then realized it might be more useful as the global option that you describe and was able to implement that in custom breadcrumbs as well.

Now I am thinking it could also be done at the theme layer, and not implemented in custom breadcrumbs at all - i.e. if the theme had an option to append the page title, then the current version of custom breadcrumbs could do what you are looking for. The Zen theme has this as an option, for example. Whether you choose to use that theme or not, you could implement an append title to breadcrumb in the phptemplate_breadcrumb function of your theme's template.php file.

So I see several possible solutions...more discussion is probably needed!

Ludo.R’s picture

I didn't know themes have such options.

What about themes that don't offer this option? My custom themes dont have this option.

I could, indeed, add my theme_breadcrumb() function to append current page title. But it's a bit more complicated than that.
I think we need a function that makes a full breadcrumb like in Administration pages for the Navigation menu.
As far as i know, only the Menu breadcrumb module offer this functionnality.

Implementing this functionnality into the Custom breadcrumbs module would have an advantage : one would not have to install an additional module, or implement this functionnality at theme level.

I don't know why Drupal 6 takes care of breadcrumbs so poorely, but i think Custom breadcrumbs would cover most of cases with this functionnality, and all in one place.

What do you think of that?

MGN’s picture

Custom breadcrumbs already has the option to pattern the breadcrumb after the menu structure. You can enable this option and set what menus to use on the custom breadcrumbs configuration page.

I agree it would be easier for most if this feature was implemented in cb. I don't like seeing the code duplication, but its not that difficult in this case.

In my test implementation its currently implemented as a global option for all breadcrumbs (not just custom breadcrumbs). There is also the option to have the crumb be a link or plain text. Another possible option would be to only apply it on pages with a custom breadcrumb. This last option would certainly justify the inclusion in the custom breadcrumbs module, since you couldn't do at the theme level.

My question is really, would this be useful? Are there other options that should be considered?

Ludo.R’s picture

Oh, i forgot the menu structure option already exists.

The option to append current page/node title would be surely appreciated for each single custom breadcrumb.
Some content types may have nodes with a loooong title which are too big to be shown in the breadcrumb, or sometimes node titles just aren't meaningful. In these cases i'd choose not to append page title in the custom breadcrumb.

Besides, the "append page/node title" option would enhance the global menu structure option.

I think if cb module has these abilities, it would cover most cases.

Drupal webdesigner’s picture

I really would appriciate it to append title to custom breadcrumb that this would be the only module you need. Is there a option to this already added, because i can't find it.

screenage’s picture

As a tempory workaround,
you can append the node title in template.php of your theme like this:

function MYTHEME_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
$breadcrumb[] = t(drupal_get_title());
return '

';
}
}

MGN’s picture

Version: 6.x-2.0-rc1 » 6.x-2.x-dev
Status: Active » Fixed

I've added this feature to 6.x-2.x-dev for further testing. I've opted to make it a global option, but only applies to pages with a custom breadcrumb. You can also choose whether the page title appears as a link or a plain text crumb. To apply page title as the last crumb for breadcrumbs on all pages on a site, the preferred way would be to do it via the theme (such as described by screenage in #12).

Status: Fixed » Closed (fixed)
Issue tags: -breadcrumb

Automatically closed -- issue fixed for 2 weeks with no activity.