Skip to content

Instantly share code, notes, and snippets.

@megclaypool
Created March 11, 2025 22:19
Show Gist options
  • Save megclaypool/dfff3b07773f40338d53327879818519 to your computer and use it in GitHub Desktop.
Save megclaypool/dfff3b07773f40338d53327879818519 to your computer and use it in GitHub Desktop.
[Easy Breadcrumb Path Replacements (Drupal)]

Ok, I finally figured out how the "Paths to replace with custom breadcrumbs" section of the Easy Breadcrumbs settings works!

  1. Each line is a separate breadcrumb.
  2. Each section of a line is separated with ::
  3. The first section is the chunk you want to replace.
  4. Then each section after that is a chunk of breadcrumb
  5. If you want your breadcrumb chunk to link somewhere, put in a pipe (|) followed by the url to link to

ex:

/node/1 :: A :: B :: C

Would render as A > B > C (none of them would be links)

ex:

/node/2 :: A | /node :: B | /node/2 :: C

Would render as A > B > C <-- unlinked

You can use regex too!
ex:

regex!/resources-tools/advocacy/* :: Resources & Tools | /resources-tools :: Advocacy | /advocacy :: <title>
regex!/resources-tools/events/* :: Resources & Tools | /resources-tools :: Events | /events :: <title>
regex!/resources-tools/articles/* :: Resources & Tools | /resources-tools :: Articles | /updates/articles :: <title>
regex!/resources-tools/news-press/* :: Resources & Tools | /resources-tools :: News & Press | /updates/news-press :: <title>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment