Jump to content

Breadcrumb Dropdowns


Robin S
 Share

Recommended Posts

Breadcrumb Dropdowns

Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

The module also adds dropdowns in Edit Template, Edit Field, Edit User, Edit Role, Edit Permission, Edit Language, and when viewing a log file at Setup > Logs.

Breadcrumb Dropdowns

Configuration options


Configuration options

Features/details


  • The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages.
  • In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page.
  • Unpublished and hidden pages are indicated in the dropdowns with similar styling to that used in Page List.
  • If the option to include uneditable pages is selected then those pages are indicated by italics with a reduced text opacity and the "not-allowed" cursor is shown on hover.
  • There is a limit of 25 pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy.
  • If the current user is allowed to add new pages under the parent page an "Add New" link is shown at the bottom of the breadcrumb dropdown.
  • If the currently edited page has children or the user may add children, a caret at the end of the breadcrumbs reveals a dropdown of up to the first 25 children and/or an "Add New" link.

Overriding the listed siblings for a page


If you want to override the siblings that are listed in the Page Edit dropdowns you can hook the BreadcrumbDropdowns::getSiblings method and change the returned PageArray. For most use cases this won't be necessary.

Incompatibilities


This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.

 

https://modules.processwire.com/modules/breadcrumb-dropdowns/
https://github.com/Toutouwai/BreadcrumbDropdowns

  • Like 13
Link to comment
Share on other sites

56 minutes ago, adrian said:

Looks awesome, but just got this on attempting to install

Hmm, it's installing as expected here. The "requires" setting I've used looks like it conforms to the example given in the Module documentation. Any ideas why it might not be working in your case?

16 minutes ago, adrian said:

I see you have a limit=25 which is a great idea, but I am wondering whether it would also make sense to order by modified date descending? I am just thinking about blog siblings as an example.

I use the "AddNewChildFirst" option in AdminOnSteroids for blog/news items and the dropdowns work well with that. But I get your point and will look at implementing something that honours the "sort settings for children" on the parent page/template. And add a note to the readme about the 25 item limit.

 

19 minutes ago, matjazp said:

This happen if you have AdminThemeBoss module installed (https://github.com/noelboss/AdminThemeBoss)

Yes, very likely will not be compatible with that module as AdminThemeBoss already modifies the breadcrumbs.

  • Like 2
Link to comment
Share on other sites

10 minutes ago, Robin S said:

But I get your point and will look at implementing something that honours the "sort settings for children" on the parent page/template.

@adrian, it seems that the $page->siblings() method used in the module already sorts by the sort field defined on the parent page or template. Do you have that set for your blog items parent?

  • Like 1
Link to comment
Share on other sites

2 minutes ago, tpr said:

Is the module using Ajax or adds the dropdowns to the markup in advance?

There's no AJAX involved - unless you had a crazy number of parents the number of pages rendered in the menus isn't that many and it's better to have the dropdowns appear instantly I think.

Link to comment
Share on other sites

1 minute ago, Robin S said:

@adrian, it seems that the $page->siblings() method used in the module already sorts by the sort field defined on the parent page or template. Do you have that set for your blog items parent?

Sorry, I didn't actually test it on a blog page tree - it was more of a theoretical question/consideration. So long as siblings() sorts automatically everything should be good.

 

24 minutes ago, Robin S said:

Hmm, it's installing as expected here. The "requires" setting I've used looks like it conforms to the example given in the Module documentation. Any ideas why it might not be working in your case?

This is weird - it has that error when installing it via class name, but it works fine when installing from an uploaded zip. Can you reproduce the issue when installing via class name?

Link to comment
Share on other sites

5 minutes ago, adrian said:

This is weird - it has that error when installing it via class name, but it works fine when installing from an uploaded zip. Can you reproduce the issue when installing via class name?

FYI, Got the same error when installing via class name.

  • Like 1
Link to comment
Share on other sites

29 minutes ago, adrian said:

This is weird - it has that error when installing it via class name, but it works fine when installing from an uploaded zip. Can you reproduce the issue when installing via class name?

Yes, it is weird. I think it must be an issue with the modules directory as the "requires" condition looks legit to me. I remember @Macrura struck something like this before with his Selectize modules - maybe he knows more about it?

For now I've removed the entire "requires" condition so the module is at least installable by classname from the directory. Will raise a GitHub issue on the PW repo if it's looking like it is a definite bug with the modules directory.

  • Like 2
Link to comment
Share on other sites

2 hours ago, matjazp said:

'requires' => 'ProcessWire>=3.0.83, AdminThemeUikit' doesn't work for you?

Ah, yes, that does work. Thanks, I didn't realise your earlier comment was a suggestion to change to the string syntax.

I will raise an issue for Ryan to take a look at as the array syntax is the one that's shown in the documentation example.

Link to comment
Share on other sites

Great module! I'm working on compatibility with AdminThemeBoss.

I'd suggest adding the following css, because the default theme has a font-size on <a> inside the breadcrumb:

.uk-breadcrumb  >li {
        font-size: .875rem;

}

I personally would not even include the title because it's there twice with the page title…

Also, I get an error when clicking on the arrow after the tree and then the root page:

1058662691_ScreenShot2018-07-18at11_47_25.thumb.png.ff272e33ca95dd0a25dc191b9d3ed009.png

  • Like 2
Link to comment
Share on other sites

25 minutes ago, Noel Boss said:

I'd suggest adding the following css, because the default theme has a font-size on <a> inside the breadcrumb of 0.825rem

Good spotting, thanks.

26 minutes ago, Noel Boss said:

I personally would not event include the title because it's there twice with the page title

That's explained in the readme:

Quote

The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages.

 

26 minutes ago, Noel Boss said:

Also, I get an error when clicking on the arrow after the tree and then the root page

Thanks, should be fixed in v0.1.1. The Home page is a special case that the module should leave alone because the Home page has no siblings to appear in a dropdown. I'm thinking that this is the error that @matjazp mentioned earlier, which actually isn't related to AdminThemeBoss. Although the modules are probably still incompatible if the "extended breadcrumb" option is activated in AdminThemeBoss.

Link to comment
Share on other sites

1 minute ago, Robin S said:

The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages.

Just my suggestion: Display the dropdown on hover over the elements … consistent behaviour like the top menu, then you don't even need the triangles anymore and also not the last item…

Link to comment
Share on other sites

3 minutes ago, Noel Boss said:

Display the dropdown on hover over the elements

I did consider that but decided that show on click is preferrable and I'll stick with that. The original request that inspired this module references the Windows Explorer behaviour that shows dropdowns on click, and I wouldn't want to see menus flying out if my mouse happens to pass over the breadcrumb on the way to the main menu.

  • Like 2
Link to comment
Share on other sites

1 hour ago, Robin S said:

I'll stick with that

Please again consider this change. It would also allow you to add a dropdown for the children of the currently edited page (the one I suggested to remove ? ).  You could add a slight delay for the hover – this way one gets not distracted.

To add visual clarity to the behaviour one could turn the angle down – if preferred, one can keep the click target to these angles:

908605726_ScreenShot2018-07-18at14_22_43.png.24c65ad7b129ad8babe44c98a3fab38c.png

  • Like 1
Link to comment
Share on other sites

On 7/18/2018 at 6:28 AM, flydev said:

Make that optional in module config, I personally prefer to click ?

I agree ... more than a preference, I think it's mandatory due to touch screen devices without pointers.. maybe the optional is add or not the hover effect

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Hey @Robin S - could you please take a look at this? I am seeing it if I try to edit a page that I don't have permission to edit. I am using AdminRestrictBranch, but I expect it might happen regardless of this. Let me know if you need any help reproducing. Thanks!

image.thumb.png.bc22a18766790ec0e613f87530d44e10.png

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...