Score:0

How do I enable breadcrumbs?

gb flag

I have a page showing a list of Article nodes. I need to display breadcrumbs on them as Homepage / Tag title / Article title. By default, Drupal shows the breadcrumbs as Homepage / Article title. I don't see any option to include the taxonomy term title*.

I also installed the Menu Breadcrumbs module, but I don't understand how to display its breadcrumbs. (Are they shown in a block?)

leymannx avatar
ne flag
Yeah normally you have a breadcrumb block and on the structure > blocks page you place it in a region where you want to show it (above content, below hero, whatever). Breacrumbs usually show the nested path of a page in the main menu. Which usually is also reflected in a page's URL alias. Like https://example.com/tag/article. Does https://example.com/tag exist on your site? And do both the tage page and article page exist in your main menu? The article item being a child of the tag item? I have made very good experience with https://www.drupal.org/project/easy_breadcrumb.
stckvrw avatar
gb flag
I see system breadcrumbs block under "Structure > Blocks" page. But if I install the "Menu Breadcrumbs" module, I don't see its block. Should the module add its own block or should I do something by myself to display the module in a block?
Score:2
de flag

Breadcrumb block relies on URL aliases to build its content. To have your breacrumb display "Home > Tag title" when you are on your article page, you need your article URL alias to "include" the tag URL alias.

Example:

  • In /admin/structure/block, make sure that the Breadcrumbs block is enabled and displayed in a region of your theme,
  • Create a "Tag" taxomony term called "Test tag" with "/test-tag" URL alias
  • Create an "Article" with "/test-tag/my-article" URL alias
  • That's it! Now when you visit "/test-tag/my-article", your breadcrumb block should display "Home >> Test tag"

Now, for having your breadcrumbs block display the current page title as well (e.g. "Home >> Test tag >> My Article"), this is no default configuration and you have to rely either on custom code (see this thread) or a module (https://www.drupal.org/project/current_page_crumb for a simple solution or, as leymannx mentioned it, https://www.drupal.org/project/easy_breadcrumb for a more customizable solution).

stckvrw avatar
gb flag
Yes, it works for system breadcrumbs, thanks! But it forces content editor to manually specify URL alias for each article. Is there a way (module?) to automate the process?
leymannx avatar
ne flag
@stckvrw – https://www.drupal.org/project/pathauto
misterdidi avatar
de flag
@leymannx is right. Pathauto is the module you need. It allows you to set URL alias patterns for your website contents and it automatically creates these URL aliases when you create/save content.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.