I just tested using the lastest Panels 3.x-dev and Ctools 1.x-dev.
-- I added a pane Menu>Development. All it provided was "Edit block", no "Edit menu links".
-- Menu block content panes doesn't have a "Edit block" or "Edit menu links."
-- I added a pane Widgets>User Login. It provides a "Edit block" link, but clicking it causes a fatal error.
-- I added a pane Widgets>Powered By Drupal. It provides a "Edit block" link, but clicking it causes a fatal error.
-- I added a pane Menus>Development (which is provided by Devel module). It provides a "Edit block" link, but clicking it causes a fatal error and no "Edit menu links".
I'll try to add submit a patch that covers the following:
1...User added menus at /admin/structure/menu/add
2...system blocks with menu links - Like "Navigation"
3...For the Menu Block module's menus, see #2400145: add "Edit menu links" to the Panels pane links dropdown menu.
4...module provided menu blocks like Devels or Features
5...fixes fatal errors on some "Edit block" links and provides "Edit menu links"
Just so we are clear, here is a screenshot of what I'm talking about.
Comment | File | Size | Author |
---|---|---|---|
#17 | edit-links.jpg | 118.98 KB | gmclelland |
#17 | 2381319-add-edit-block-in-pane-dropdown-links-17.patch | 4.31 KB | gmclelland |
Comments
Comment #1
gmclelland CreditAttribution: gmclelland commentedI'm guessing this code would go in:
panels/plugins/display_renderers/panels_renderer_editor.class.php:
to be included in function get_pane_links or should it just be on it's own like:
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedHm. No I'd put hooks directly in panels.module, definitely not in a class file.
Comment #3
gmclelland CreditAttribution: gmclelland commentedThanks @merlinofchaos! Here's a patch. Hope that helps
Panels 3.x-dev already has support for edit links for Mini Panels and custom content panes. Now we just need to finish it and add edit links for blocks(this issue) and views #1948278: Get an edit link for the view panes in Page Manger.
Comment #4
gmclelland CreditAttribution: gmclelland commentedOops.. I didn't see the comment about the Deprecated functions. Better add my stuff above that line. Here is a new patch.
Comment #5
DamienMcKennaGiven the Views integration is already handled by #1948278: Get an edit link for the view panes in Page Manger, why not remove the Views integration from this patch and improve the other one as needed?
Comment #6
gmclelland CreditAttribution: gmclelland commented@DamienMcKenna - Well, I wasn't quite sure of where the code for views blocks should go? Maybe it should go directly in the views.module file? The patch in #1948278: Get an edit link for the view panes in Page Manger for views panes goes in the views_content module.
I'll try to update both patches (here and the views modules)
Comment #7
gmclelland CreditAttribution: gmclelland commentedOk, I split out the code into another issue for views. #2387193: Get an edit link for the views blocks in Page Manger
Here is a new patch for this issue.
Comment #8
japerrygmclelland, shouldn't the link be: 'admin/structure/block/manage/block/' . $name_of_block . '/configure' ?
Comment #9
gmclelland CreditAttribution: gmclelland commented@japerry - yes I think your right. Here is an untested updated patch with the change.
Comment #10
gmclelland CreditAttribution: gmclelland commentedNoticed it has 'edit_custom_content' and it instead needs to be 'edit_block'. I'm also going to try to include an edit link for menu blocks as well.
Comment #11
gmclelland CreditAttribution: gmclelland commentedHere is a patch that adds "Edit block", "Edit menu links", and "Edit: fieldname" links. I took and had to modify the code from @bobodrone PAL module https://www.drupal.org/sandbox/bobodrone/1497388
Hope that helps
Comment #12
gmclelland CreditAttribution: gmclelland commentedThe patch in #11 adds Edit field links support, but it uses a sql query per field and I'm not sure how it works when a field is shared between two content types. It does this because you have to know the field's bundle to edit the field.
After more testing, I can't find a way to reliably get Field edit links because they require the field instance's bundle name in the link.
So were back to just Blocks and Menu links. Here is a new patch. Hope that helps
Comment #14
gmclelland CreditAttribution: gmclelland commentedHere is a reroll to accommodate the latest changes in dev.
Comment #15
gmclelland CreditAttribution: gmclelland commentedComment #16
MichelleI have been trying to test this and am confused. Without the patch, blocks have "configure block" and menus have "configure block", "list links" and "edit menu" in the pane drop down. What is this patch adding? It looks like it's just making minor changes to the existing block link and then adding in an entry for menus that must already exist somewhere else because it's already there in the drop down.
I'd be happy to test this if you could clarify the steps. :)
Comment #17
gmclelland CreditAttribution: gmclelland commentedHi Michelle. Yes your right, this is confusing. After more research, this was more complex than I thought.
I just tested using the lastest Panels 3.x-dev and Ctools 1.x-dev.
-- I added a pane Menu>Development. All it provided was "Edit block".
-- Menu block content panes don't have a "Edit block" or "Edit menu links."
-- I added a pane Widgets>User Login. It provides a "Edit block" link, but clicking it causes a fatal error.
-- I added a pane Widgets>Powered By Drupal. It provides a "Edit block" link, but clicking it causes a fatal error.
-- I added a pane Menus>Development (which is provided by Devel module). It provides a "Edit block" link, but clicking it causes a fatal error.
I'll try to add submit a patch that covers the following:
1...User added menus at /admin/structure/menu/add
2...system blocks with menu links - Like "Navigation"
3...For the Menu Block module's menus, see #2400145: add "Edit menu links" to the Panels pane links dropdown menu.
4...module provided menu blocks like Devels or Features
5...fixes fatal errors on some "Edit block" links and provides "Edit menu links"
Just so we are clear, here is a screenshot of what I'm talking about.
Hope that helps
Comment #18
gmclelland CreditAttribution: gmclelland commentedUpdating issue summary.
Comment #19
MichelleAh, screenshot helps tons. I was in the wrong spot! I was viewing a page and looking at the dropdowns there, not in the page building area.
Based on you saying that you're going to try and do a new patch, I'm setting this to "Needs work". Not sure how much more contrib time I will have but I will try to review the new one when you have it.
Comment #20
gmclelland CreditAttribution: gmclelland commentedHi @Michelle, setting this back to NR. See the patch in #17. I shouldn't have said I'll try, because I did provide a patch. :)
Comment #21
MichelleSorry about the mixup. I had the patch scrolled off the screen, left for a while, then came back and read the post, and totally missed there was a patch up there.
Ok, I confirmed the fatal errors without the patch, then applied the patch and tested the following:
* User created menu - Edit block / Edit menu links both work.
* Core provided menu - Edit block / Edit menu links both work.
* Devel provided menu - Edit block / Edit menu links both work.
* Who's online block - Edit block works. No edit menu links as expected since it isn't a menu.
Looks good to me. My only concern is whether or not this should be split into two issues, one to fix the fatal errors which is a bug and one to add the menu links, which is a feature. I'll leave that up to you/the maintainers, though.
Comment #22
mrjmd CreditAttribution: mrjmd commentedOld parent issue is Closed (Fixed), changing parent to META issue for next release.
Comment #23
japerryNaw both issues here work fine. Looks good to me, and fixed!