Problem/Motivation

  • It is very difficult to use devel menu items without devel menu block.
  • Sometimes developer is working with multiple themes and it is not possible to add devel menu block to all themes sidebars.
  • Some themes has no sidebar like seven so there is no region to add devel menu. So during development if you want to use devel menu items there is no way you can access it.

Solutions

  1. Use shortcut bar but it only support limited number of links in D7.
  2. Use admin_menu home link to list all devel meun items
    admin_menu_devel.png
    this is /devel/variable link replace is with /devel link and added devel menu items as submenu.
  3. To quick access of devel links add default /devel link to navigation just like /admin/structure link in core where a user can see all the menu items.
    Devel Menu Links _ d716_1350599095682.png

For solution #3 the patch is added.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pcambra’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

I was thinking the same thing, love the idea, let's move it to D8 as that comes first

jibran’s picture

Patch for D8.

moshe weitzman’s picture

Status: Needs review » Needs work

That implementation looks weird. Drupal always emits lists via markup building functions, instead of doing it on your own. But is there some reason we don' just return the same render array that our Devel block emits?

jibran’s picture

Status: Needs work » Needs review
FileSize
1.58 KB

I want to make the page same as admin/structure. I tried to use system_admin_menu_block_page and I ended up copying this from theme_admin_block_content. Now I have changed it to theme_item_list

salvis’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev

Screenshot please?

salvis’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

Oops...

jibran’s picture

I have added /devel to admin paths. I think it is a logical thing to do as all other menu items are admin path.

salvis’s picture

Thanks -- here they are, presumably showing the new devel path:

http://drupal.org/files/Devel%20Menu%20Links%20_%20d8devel_1350729108130.png

http://drupal.org/files/Devel%20Menu%20Links%20_%20d8devel_1350729320242.png

I tried to use system_admin_menu_block_page

Why did this not work?

+++ b/devel.pages.inc
@@ -1,5 +1,30 @@
+// Menu callback that shows all devel menu links.

We'll need a proper docblock. Don't touch the others, that's part of a pending patch.

jibran’s picture

I have looked further in system_admin_menu_block_page and finally able to use it.
Changes made in this patch:

  • To list all the menu items core system_admin_menu_block_page function is used.
  • Title of the devel menu item is changed to 'Devel Link'. It was 'Devel Menu Links' before.
  • devel menu item is now part of devel menu before it was a navigation link.
  • Doc block is added to menu call back function.

Landing page is the same as shown in the above screenshots.

jibran’s picture

In this patch devel_page is gone. Simple menu item is enough to show the landing page.
Landing page is the same as shown in the above screenshots.

moshe weitzman’s picture

That looks better. Is it really desireable to add this link to the devel block? Maybe this should omit 'menu_name' => 'devel',?

jibran’s picture

Without 'menu_name' => 'devel', 'system_admin_menu_block_page' doesn't work properly.

juampynr’s picture

Looks good. Maybe I am missing something but why don't we place the path at admin/config/development/devel_menu_items? It would make these features more easy to discover.

jibran’s picture

why don't we place the path at admin/config/development/devel_menu_items?

I think this is not a good idea

  1. This is not related to config so why use admin/config
  2. It is used to list devel menu items so it should be the part of devel menu items. We have devel/php, devel/reference and etc. Why don't we have devel?
  3. It is normal practice in core to list all the child menu items if menu item has no child with MENU_DEFAULT_LOCAL_TASK i.e. we have admin/structure for admin/structure/block, admin/structure/menu and etc.

I have added 'expanded' => TRUE, to devel menu item now devel menu block looks like this by default.

devel_block.png
I think this address the concern in #11

juampynr’s picture

OK for me then.

Maybe the question is to be addressed in another issue such as "why some callbacks are not under admin/config/devel so they are visible at the admin menu?"

salvis’s picture

Maybe the question is to be addressed in another issue such as "why some callbacks are not under admin/config/devel so they are visible at the admin menu?"

jibran has answered that already: none of these pages are configurations, except for 'Devel Settings', and someone (I don't know who) really went out of this way to manage to put that item in both places.

So this patch now causes a new top-level menu item to appear in the Development block? That looks odd and is not really what we want...

jibran’s picture

So this patch now causes a new top-level menu item to appear in the Development block? That looks odd and is not really what we want...

I kind of agree to this but if this is the parent for all menu items(because it is /devel) it should be the part of devel menu block. It doesn't make sense to move it to navigation menu. But I think we can live with that because it is by default expanded.
Any other suggestion.

juampynr’s picture

Even if it is not configuration, it is what we have and what Drupal users go and look for after installing a module (that or Structure). If every contrib module would add it's own menu tree, the top level menu bar would be a mess.

jibran’s picture

IMHO devel menu items neither belong to admin/config/development/devel nor anywhere currently in admin menu items. Perhaps we can introduce new menu item admin/devel just like admin/commerce after enabling commerce module. But I think separate devel menu is much better approach after all development is different then administration.

jibran’s picture

re-roll

salvis’s picture

If every contrib module would add it's own menu tree, the top level menu bar would be a mess.

The same goes for admin/config. We don't want to provide a bad example and encourage contribs to dump non-config stuff there.

IMHO devel menu items neither belong to admin/config/development/devel nor anywhere currently in admin menu items. Perhaps we can introduce new menu item admin/devel just like admin/commerce after enabling commerce module. But I think separate devel menu is much better approach after all development is different then administration.

I agree. The advantage of having the Development menu in a block of its own is that the block can be controlled completely independently of any other permissions (like access to the admin menu tree). On my dev sites Anonymous always gets access to the Development and Switch User blocks — having that stuff in the regular menu structure would be confusing.

Moreover, the block can be put wherever is best (or even just possible) for any given theme, even if you have no menu. The block is an essential feature that we must not give up.

Seems like we're turning in circles. What we currently have may be the best compromise we can get within the given constraints...

jibran’s picture

I think it is good that now we have top level menu item because now we can replace variable editor with devel in admin menu and all the devel menu items can be access from it.
admin_menu_devel.png

pcambra’s picture

Seems like we're turning in circles. What we currently have may be the best compromise we can get within the given constraints...

Agreed, block should stay, but I like the idea of having a devel menu on top (that would raise awareness on devel being enabled in your current environment, it could be even in a different color) but having it configuration > Development is also ok for me.

Can we reach any agreement in adding this option? :)

salvis’s picture

I like the idea of having a devel menu on top

What do you have on top? I have Admin Menu — it puts the most important items into the Druplicon menu item.

I'm not sure we're important enough to grab a top-level menu item. It's OK when a major module that provides the bulk of the functionality of my site gives me easy access to its functionality, but I really hate it when some helper that I may use occasionally is so immodest to insist on putting itself into my face all of the time.

Can we do this as opt-in?

jibran’s picture

sun’s picture

FileSize
6.75 KB

I cleaned up the link titles + descriptions.

jibran’s picture

26: devel.menu_.26.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 26: devel.menu_.26.patch, failed testing.

jibran’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
6.76 KB
3.43 KB

Reroll. Please can we move forward with this patch it is small feature.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for taking this up again -- the proposed code changes still look good to me :)

salvis’s picture

Status: Reviewed & tested by the community » Needs work

Please excuse the dumb question, but where do we see the benefits of this patch?

I cannot find the Devel menu, with or without this patch. IOW, the patch does not bring us closer to the stated goal of this issue.

@sun: Please bring admin_menu back. This toy in core just does not cut it.

jibran’s picture

Please let me know that what work this patch needs. IMHO there is nothing to fix here. If you can't commit it then mark is won't fix. I really want this option in D7 that is why I opened up the issue and due to stupid process I have to fight a battle to push it to D8 first and then D7.
I am humbly requesting please mention the issue on which I can work on so that we can able to commit it. If not then won't fix it so that I don't have to look back to this issue again.

willzyx’s picture

Status: Needs work » Closed (outdated)

Closing this issue.
For the 8.x branch I have opened #2839502: Add toolbar integration - make devel menu items more accessible
Feel free to reopen this issue for 7.x if you think that there is something that can be improved. Thanks