Often times, it makes sense to break content up into mini panels and then position the mini panels within a panel node or page. However, when a mini panel is viewed within a Panel page or node, there is no way to edit the mini panel content directly from viewing the content. With standard blocks, you get the contextual links, making it very easy to jump over the the bock configuration page to edit the block. But with mini panels there are no contextual links.
I think it would bring a decent usability improvement to provide contextual links that link directly through to the mini-panel edit pages (or even through to each of the individual tabs - settings, context, layout, context). This would save people having to try and find the mini panel manually to edit it and would improve the user flow when editing panel pages and nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | panels-provide_contextual_links_mini_panels-1388476-12.patch | 1.42 KB | acrollet |
| #8 | panels-provide_contextual_links_mini_panels-1388476-8.patch | 1.27 KB | acrollet |
| #7 | panels-provide_contextual_links_mini_panels-1388476-7.patch | 1.23 KB | acrollet |
| #4 | minipanels.PNG | 30.93 KB | jisuo |
Comments
Comment #1
Letharion commentedSounds like a good feature request, but I'm moving it to postponed for now.
Comment #2
jisuo commentedYes this would be much appreciated. I think I will look into this myself and see how much job there is.
edit:
I just did a quick ugly fix for now that I'll use. In the file
ctools/includes/content.incin thefunction ctools_content_admin_info($type, $subtype, $conf, $context = NULL) { ... }.Changed:
...to this:
Comment #3
jesmaster commentedI just tried the above code and I still don't see an edit button on mini-panels in panel regions on a panel page. I put a die after the if( and the code isn't even executed when the panel page loads. Am I doing something wrong?
Comment #4
jisuo commentedSorry was unclear. This doesn't add a contextual link.
If you edit the page that has a panels, an edit link will be visible on mini panels, like this:
Comment #5
jesmaster commentedAh I see.
I was looking for the Edit button (the gear icon) to appear on hover on the actual panel page when hovering over mini-panels and custom content the same way it does for nodes that are in a panel region. Do you have any idea how to accomplish this?
Comment #6
mrfelton commented@Jesmaster - what you are asking for is exactly what I was looking for in the original feature request. @jisuo's patch doesn't seem to address this, but instead adds an edit links into the admin page.
Comment #7
acrollet commentedPatch attached, adds a contextual link titled 'Edit mini panel'. It only provides the link to the main edit page, rather than individual (context, content etc.) pages, as I'm unclear as to whether it's possible to provide links for the sub-pages using the standard contextual system. Also, it seems a bit cleaner to just have one link. Using hook_menu_alter() doesn't feel like the cleanest approach, but it seems that it would take an additional patch to the ctools export_ui to manage without. Disclaimers aside, this patch is working for me and meets the use-case in the feature request.
Comment #8
acrollet commentedbleh, new patch made from the panels directory attached.
Comment #9
acrollet commentedI should also note that menu_rebuild() will need to be called after applying this patch for the contextual links to be displayed.
Comment #10
damienmckennaI'll be sure to test this with Menu_MiniPanels and make sure its next release is compatible. Thanks Adrian.
Comment #11
jwilson3Code looks good.
Original Request:
I agree that it makes sense to only have one link (as mentioned in #7), but instead of linking to the first page... the link should go to the last page (the Content "tab" if you can call it that), which would follow the behavior of the Panels module, which sends its contextual link for the "Edit panel" to the "Content" vertical tab).
Eg, Use:
/admin/structure/mini-panels/list/%ctools_export_ui/edit/contentas the link destination.Comment #12
acrollet commentedSpent a little time trying to make this happen, but I'm not up enough on the intricacies of the menu system as they relate to contextual links to make it all work together correctly. (The choice ended up between getting the link to show OR have the content edit tab still work.) The other option would be to abandon the current approach and use hook_contextual_links_view_alter() to just chuck the link in there. Hoping for feedback from a maintainer about which approach they would prefer to add. In the meantime did a slight bit of cleanup to the current patch, attached.
Comment #13
acrollet commentedAs an FYI, the patch in #12 breaks versions of menu_minipanels after rc6 ("Array" is the only display). I'm willing to work further on this patch if there's some indication that it could be committed...
Comment #14
merlinofchaos commentedI fixed this with a much simpler patch.
Comment #15
tthenne commented^^Yes he did, but if you are looking for the patch number you won't find it under #1388476, rather try http://drupalcode.org/project/panels.git/commit/6c8a121. It tripped me up at first because I was looking for a patch similar to @acrollet #12 but looked in the commit history for @merlinofchaos' commit. Thanks for this feature add, I think it was a good request to have.
Comment #17
jwilson3For anyone interested, I've posted a follow-up issue with patch that extends the mini panels contextual links functionality when used as blocks (either by core Block module, or the contrib Context module):
#1966020: Contextual links for mini panels placed as blocks.