Add your favorite menu in the Drupal Toolbar

Usage :

  • Manage your menus (Structure > Menu)
  • Go to Config > Toolbar Menu > Toolbar Menu settings
  • Check all menus you want to appear in your toolbar
  • Re-order the menu entries if you want
  • Save the configuration
  • Your selected menus must appears in the toolbar

Toolbar Menu

Requirements :

  • Toolbar module

Project sandbox :
https://www.drupal.org/sandbox/vince60/2592133

Pareview results:
http://pareview.sh/pareview/httpgitdrupalorgsandboxvince602592133git

Git clone:
git clone --branch 8.x-1.x http://git.drupal.org/sandbox/vince60/2592133.git toolbar_menu

Manual reviews of other projects
https://www.drupal.org/node/2573087#comment-10504054
https://www.drupal.org/node/2603436#comment-10506298
https://www.drupal.org/node/2638376#comment-10717396

CommentFileSizeAuthor
#14 toolbar_menu_review.png166.11 KBdanny_joris
#9 toolbar_menu.png106.49 KBvpeltot

Comments

vpeltot created an issue. See original summary.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

vpeltot’s picture

Issue summary: View changes
vpeltot’s picture

Issue summary: View changes
woprrr’s picture

Issue summary: View changes
woprrr’s picture

All best practice are in this module. After tests all is okay and work a charm :) Thanks for your work @vpeltot.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Followsthe licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
vpeltot’s picture

vpeltot’s picture

Issue summary: View changes
vpeltot’s picture

StatusFileSize
new106.49 KB
vpeltot’s picture

Issue summary: View changes
prashant.c’s picture

@vpeltot

Nice module but while testing this i found following:

In case of enabling "Administration" menu in the toolbar on click of Administration only "Administration" link is displayed which is taking the user to /admin page.

Instead it should display the links like
Content
Structure
Appearance etc. on the toolbar itself.

jeanfei’s picture

Hi @Prashant.c,

For me the module works fine.
Actually, you select the menus you want in the toolbar in : admin/config/toolbar_menu/settings
Menus checked will be displayed in the toolbar, and items menu (only first level items) are displayed.

So for menu "Administration" will display only one item : Administration item menu (@see admin/structure/menu/manage/admin).
Feel free to create your own custom menu with the links you need.

patilvishalvs’s picture

Nice module

Here is the testing report

Manual Review

Individual user account

Yes: Follows the guidelines for individual user accounts.

No duplication

Yes: Does not cause module duplication and/or fragmentation.

Master Branch

Yes: Follows the guidelines for master branch.

Licensing

Yes: Followsthe licensing requirements.

3rd party assets/code

Yes: Follows the guidelines for 3rd party assets/code.

README.txt/README.md

Yes: Follows the guidelines for in-project documentation and/or the README Template.

Code long/complex enough for review

Yes: Follows the guidelines for project length and complexity.

Secure code

Yes: Meets the security requirements.

danny_joris’s picture

StatusFileSize
new166.11 KB

Automated Review

All good: http://pareview.sh/pareview/httpgitdrupalorgsandboxvince602592133git-8x-1x

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes (but very basic): Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. (*) In a few places the entity label is used to create machine readable strings, use entity ID instead. 'toolbar_menu_' . $menu->label() . '_links' => array(
  2. (+) A translatable string only containing a variable is pointless: t('@label', ['@label' => $menu->label()]),
  3. The tab link value/title and the tab title's title attribute is identical. While it's good to include a title attribute, using this with a screen reader would only result in calling out the same title twice. Maybe you can use the menu's "Administrative summary" value instead.
  4. Including hook_help() would be helpful.
  5. The CSS file can be renamed to follow the D8 CSS file organization. css/toolbar_menu.module.css would work I believe.
  6. The toolbar items that are added are being placed between other programatically placed items, seemingly random. I'm not sure how this could be solved. Maybe existing toolbar items can be included in the draggable table? See attached screenshot.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

This review uses the Project Application Review Template.

danny_joris’s picture

Status: Needs review » Needs work
danny_joris’s picture

Status: Needs work » Needs review

Yes, the entity label/id issue is critical and needs to be addressed before this module can be approved, but I'm going to revert the status back to "Needs review", because I don't want you to lose your PAReview tag over this: https://www.drupal.org/node/1975228

vpeltot’s picture

@Danny_Joris Thank you for your relevant review.

  1. Corrected
  2. Corrected
  3. Corrected
  4. Corrected
  5. Corrected
  6. That could be a great feature. But at this time, I don't know how to do that. Some modules add their toolbar items, and place them in the toolbar totaly arbitrarily (they don't provide #weight), and another modules (like user) enforce the #weight value ('#weight' => 100).
    I'll think about it. I'll add this feature in my project issue queue.
jeanfei’s picture

Status: Needs review » Reviewed & tested by the community

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.

This review uses the Project Application Review Template.

klausi’s picture

Removing review bonus tag, only 2 reviews listed in the issue summary. Make sure to complete 3 reviews and link them all in the issue summary.

vpeltot’s picture

Issue summary: View changes
vpeltot’s picture

Issue tags: +PAreview: review bonus

@klausi

My apologize, I thought I had made three code review...
Here is the third review : https://www.drupal.org/node/2615390#comment-10632438.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

Review of the 8.x-1.x branch (commit b4f7a0f):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: /home/klausi/pareview_temp/toolbar_menu.permissions.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     2 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: /home/klausi/pareview_temp/src/Form/ToolbarMenuForm.php
    ---------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------
     131 | WARNING | [x] A comma should follow the last multiline array item.
         |         |     Found: ]
    ---------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------
    
    FILE: /home/klausi/pareview_temp/toolbar_menu.info.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     7 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

But otherwise looks good to me.

Thanks for your contribution, vpeltot!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.