Skip to main content
Drupal breadcrumps

Breadcrumbs with Hansel module-2 : Steps to create Breadcrumbs for all scenarios

The switches and hopes in the Hansel module is called as Hansel Flow. To make a Hansel module work, we should create

  1. A new rule called "Start"(It is a standard and fixed name to make the flow happen, so do not change this under any situation),
  2. Under parent as 'root', add a single link as 'action with breadcrumbs' and switch as 'action'.
  3. I Insist to go with switch as the action because it can cover a huge and future intention to developing sites.

The next button leads to another form where we can specify the Name and Link.

  1. In most cases the name would be 'Home' or 'Site name'. The main purpose of the start is to indicate the root path in the site, where in most cases it is home.
  2. The Link can be given as <front> to redirect to the home page. It is a stash thumb rule to switch with path alias. Once completed finish the formalities.

So, now we have a Home (Hansel flow name as start). As a wrap up thing, click in the switch on path alias and select 'contains' instead of 'starting with'. Before getting into the next part I expect the reader to have a good perceptual ability. The Hansel flow is not all about what I have done, it is about what you need, With this caveat i get into the real stuff of the Hansel flow.

Rule 1: All the other rules should atleast have start as its parent, only then we can make the flow happen else case ignores the rule and stops the generation of the breadcrumbs.

Rule 2 : Please try to use aliased path in the URL.

Rule 3 : Use <front> to redirect to home page.

Rule 4 : Use <none> to link to nothing in 'Add sinle link'.

Create other rule's name based on the URL (Since we are gona switch based on the path alias) and use 'start' as their parent.  The actions with the Breadcrumbs provides a clear picture about how to use this Hansel flow. We need to remember one thing at this point, by default we get single hierarchy of the present page title as in the Breadcrumbs. So we need not create the flow for the 2 step navigation. The 'start' will take of it. for example, "Home->Blog" will be created by the Hansel flow even if we forget to create a rule for Blog.

Example Flow:

  1. Create a rule called 'info' with start as parent. Add single link and use switch as action (Use goto about). In the next form enter title as 'info' and path as 'info' (Do not use / before the paths).
  2. Create another rule called as 'about' with info as its parent (use goto city)t. Use the above settings to complete this rule.
  3. Similarly create another rule called as 'city' with about as its parent and complete the settings same as the above steps.

The above case can be extended as per your needs. The prime rule to remember, Nothing related to breadcrumbs is impossible for Hansel so do not blame the module for not doing what you want, instead claim the blame as i did in the initial stages to learn this.