Recommended Posts

Breadcrumb Dropdowns

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

bd

Installation

Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.

There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.

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 dropdowns you can hook the BreadcrumbDropdowns::getSiblingsmethod 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 10

Share this post


Link to post
Share on other sites

Looks awesome, but just got this on attempting to install:

image.thumb.png.f3d8021d5a85161144fdc1225d73e3f0.png

  • Like 1

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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…

Share this post


Link to post
Share on other sites
3 minutes ago, Noel Boss said:

Display the dropdown on hover over the elements

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

  • Like 3

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Anssi
      A simple module to enable easy navigation between the public and the admin side of the site. After installation a green bar will appear to the upper side of the screen, containing a few navigation elements and displaying the PW version number.
      Heavily inspired by @apeisa's great AdminBar (Thanks!). I needed a bit simpler tool for my projects and as a result, this was made. Available on GitHub .

    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
    • By David Karich
      Thanks to the great Pro module "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use this module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      With this proof of concept I have created a module which adds the feature to copy a repeater item to the clipboard so that you can paste this item to another page with the same repeater field. The module has been developed very rudimentarily so far. It is currently not possible to copy nested items. There is also no check of Min/Max. You can also only copy items that have the same field on different pages. And surely you can solve all this more elegantly with AJAX. But personally I lack the deeper understanding of the repeaters. Also missing on the Javascript side are event triggers for the repeaters, which would make it easier. Like e.g. RepeaterItemInitReady or similar.
      it would be great if @ryan would implement this functionality in the core of RepeaterMatrix. I think he has better ways to implement this. Or what do you think, Ryan?
      Everybody is welcome to work on this module and improve it, if it should not be integrated into the matrix core. Therefore I put it for testing and as download on GitHub: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDublicate
      You can best see the functionality in the screencast: 
       
    • By anderson
      Hi,
      Please take a look at this:
      https://templatemag.com/demo/Good/
      The upper nav bar, including dropdowns like "pages" and "portfolios", what do you call this whole thing? At first I guess it's called "dropdown nav bar", but seems not.
      AND of course, what's the simplest way/module to achieve this in PW?
      Thanks in advance.
    • By Sebi2020
      Hey, I'm new and I created a simple module for tagging pages because I didn't found a module for it (sadly this is not a core feature). This module is licensed under the GPL3 and cames with absolutly no warranty at all. You should test the module before using it in production environments. Currently it's an alpha release. if you like the module or have ideas for improvements feel free to post a comment. Currently this fieldtype is only compatible with the Inputfield I've created to because I haven't found  an Inputfield yet, that returns arrays from a single html input.
      Greetings Sebi2020
      FieldtypeTags.zip.asc
      InputfieldTagify.zip
      InputfieldTagify.zip.asc
      FieldtypeTags.zip