Compatibility issue between solo breadcrumbs and entity hierarchy

Created on 10 February 2025, 14 days ago

Hello, Alaa

This module( entity_hierarchy โ†’ ) is not compatible with solo breadcrumbs, However, for other theme, it is no problem.

For solo, it generates two title items. Can this problem be solved?

Repro steps:
1.<code>composer require 'drupal/entity_hierarchy:^5.0@alpha'
2.Install module (Entity Hierarchy and Entity Hierarchy Breadcrumb)
3.Add fields to the article type. (/admin/structure/types/manage/article/fields/add-field)
4.Choose a type of field: Entity reference hierarchy
5.Enter "Test" as field label name.
6.Type of item to reference > Content
7.Content type > Article
8.save
9.Create several articles, pay attention to referencing them in the "Test" field.
For example:
Article 1: Title is "Box". No Reference articles.
Article 2: Title is "Fruit". Reference "Box" article by "Test" field.
Article 3: Title is "Apple". Reference "Fruit" article by "Test" field.

Hierarchical Structure: Box > Fruit > Apple

10.Now take a look at breadcrumbs of Apple article page.
I see two Apples:
Home > Box > Fruit > Apple > Apple

11.Switch to Olivero or other theme as the default theme.
I see it's normal:
Home > Box > Fruit > Apple

๐Ÿ’ฌ Support request
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡จ๐Ÿ‡ณChina hastroop

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @hastroop
  • ๐Ÿ‡จ๐Ÿ‡ณChina hastroop

    I found an option: Tick this box to exclude the page title from the Breadcrumb. However, it only removes one, and the another title still exists.

    Also, the page title can remove at breadcrumbs, Is there also an option to exclude the "Home" breadcrumb. Thank you.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States flashwebcenter Austin TX

    Hello,

    I will review and test the theme together. In the meantime, the breadcrumb feature can be disabled in the theme settings under Breadcrumb.

    Best wishes,
    Alaa

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinayakmk47

    I have fixed the issue and created the merge request please review and approve the changes made.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinodhini.e chennai

    Reproduced this issue in Drupal 10.4.1 and successfully merged the code in Merge Request #5. The patch is working as expected.

    Attached are screenshots showing the issue before and after applying the patch.

    Thanks!

  • ๐Ÿ‡จ๐Ÿ‡ณChina hastroop

    After testing, the code only solved one additional title item for breadcrumbs, However, an option of the theme breadcrumbs setting is invalid.

    "Tick this box to exclude the page title from the Breadcrumb."

  • ๐Ÿ‡จ๐Ÿ‡ณChina hastroop

    The perfect result should be:
    Check this option, the breadcrumbs will look like this: Home > Box > Fruit = Its function is to remove the title item of breadcrumbs.
    Cancel this option, the breadcrumbs look like this: Home > Box > Fruit > Apple

  • ๐Ÿ‡จ๐Ÿ‡ณChina hastroop

    Also, is it possible to add an option to remove breadcrumbs "Home" item?

    Removing and retaining these two breadcrumb items are two common functions of breadcrumbs.

    Thank you

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States flashwebcenter Austin TX

    Hello,

    Thank you for your guidance on testing. I followed your instructions and was able to identify the issue.

    By default, Drupal does not include the page title in the breadcrumb. Solo provides an option to add this feature, as do some other contributed modules. Solo's functionality works as intendedโ€”it either adds the title or does not, based on the configured settings. However, Solo does not include a feature to remove titles that were added by other contributed modules.

    When the Entity module is installed, it also adds the page title to the breadcrumb, which results in duplicate titles when used with Solo. If the title option in Solo is disabled, it simply reverts to the default Drupal behavior.

    To improve this functionality, I have refactored the breadcrumb handling in Solo. Now, when the title option is enabled, Solo will add the title to Content, Views pages, Taxonomy pages, User pages, and Webform pages. However, I have introduced a new check to ensure that if another module or theme has already added the title, Solo will not add it again.

    Feel free to download the latest development version โ†’ or disable the feature and use the title provided by the entity module.

    Best wishes,
    Alaa

  • ๐Ÿ‡จ๐Ÿ‡ณChina hastroop

    Thank you for resolving the issue, so Solo will not remove the title item added by Entity Hierarchy Breadrumb. This may be a feature request for the Entity Hierarchy module. I have already made this request there.

Production build 0.71.5 2024