Increase number of entries in breadcrumb


Is there a way to have more entries directly shown in the breadcumb?

Around 20-30 would be nice.

By default it seems to be 10 entries. For the next 10 you have to press ‘more’.

I think it’s 5 by default:

    ## Default mode: display the hierarchy for the current page
    #hierarchy($NULL {'id': 'hierarchy', 'limit': 5, 'treeNavigation': true})

Right now this cannot be controlled by a configuration parameter apparently (you could raise a JIRA issue for this).

However, as a workaround, you could create a custom skin and override hierarchy.vm which contains this line above.

Ah no the limit seems to be the number of breadcrumb items displayed and not the number of entries displayed inside each breadcrumb item.

So the vm seems to be hierarchy_macros.vm where I see:

    #set ($treeParams = {
      'class': 'breadcrumb-tree',
      'limit': 10,
      'links': true,
      'openTo': $openToId,
      'root': $rootId,
      'showTranslations': $xwiki.isMultiLingual(),
      'showWikis': $showWikis

It’s the value 10 that you want to change probably.

And where can I find the file ‘hierarchy_macros.vm’ to edit it?

I want to increase the horizontal breadcrumb limit. Where do I find hierarchy.vm?

You have it in the XWiki WAR, skins/flamingo/hierarchy.vm . Note that hierarchy_macros.vm is also in the XWiki WAR, but in the templates folder.

1 Like

As there is the problem that every wiki update can revert changes in hierarchy.vm I thought about a JavaScriptExtension. I will try this approach for a while:

let stateCheckBreadcrumbs = setInterval(() => {
  if (document.readyState === 'complete') {
    // document ready
    if (document.querySelector("#hierarchy > li.ellipsis > a")) {
      document.querySelector("#hierarchy > li.ellipsis > a").click();
}, 100);