The overlay used by FAPE can be a little obtrusive, compared to e.g. Edit. How about using a smaller dialog instead?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drupalninja99’s picture

+1

drupalninja99’s picture

I am wondering if this is even in the scope of this module. We really just need a module that is an alternative to overlay that will take an admin path and load it in a smaller popup. It doesn't necessarily have to be in this project. It could be a project like overlay_mini or something like that.

DamienMcKenna’s picture

It's more than that, just having a small popup won't give us the field editing capabilities that FAPE has.

drupalninja99’s picture

FAPE actually doesnt integrate directly with overlay. It just uses an admin path that overlay intercepts. So conceivably you could create a module that deals with an overlay replacement as opposed to having to integrate with FAPE directly. If you used the ctools modal overlay instead of the overlay module it would be /better/ than the overlay although still not great. I haven't seen anything that's as good as the edit's modules inline editing. Pop-ups just aren't great and they're slow.

drupalninja99’s picture

FileSize
148.03 KB

I have changed my mind a bit after playing around with ctools modal popups. I do think adding ctools modal popup support to FAPE is a natural fit and should be a patch that's evaluated as opposed to a separate module. I am attaching a screenshot where I got a semi-functional version of this working.

Ctools modals would be faster and look better. Also if we could use AJAX to save and update the content on the page (like Panels IPE) then it would be far superior to overlay which requires a redirect after saving.

drupalninja99’s picture

Status: Active » Needs review
FileSize
3.85 KB

Here is a patch that adds ctools modal integration to FAPE which I think is more fitting than overlay. One thing I like is for the potential for this really to speed things up. Overlay is very slow.

With the ctools modal it pops up quick but I was unable to figure out how to grab the updated pane html to update the field that was just updated so it just reloads the page afterwards which is slow. It would be a much better experience to have it update the area like Panels IPE.

It would be great to use 'ajax_command_html' to update that area of the page that was just updated but that proved too complex for me to figure out.

A) I could not figure out how to identify the field that was just updated B) I couldn't figure out what ctools function I needed to re-render the output. I was using Panopoly as my test site. Since it's using panelizer maybe I can use some panelizer function where I pass the entity id and view mode and fetch it that way?

DamienMcKenna’s picture

Cool.

The code for rendering the appropriate entity is buried pretty deep in Page Manager, IIRC, I can help you with it tomorrow if you like.

drupalninja99’s picture

I think what I need is to figure out how to render a Panelized node view mode.

drupalninja99’s picture

So I actually figured out that just user render and entity_view is good enough to refresh the area that was updated. The new problem I am having is I don't know how to detect the view mode of the node being editing. I thought one of the arguments in hook_panels_pane_content_alter would have some data indicating what the view mode is but I can't find it.

drupalninja99’s picture

Even using javascript to try to figure out the view mode seems difficult and hacky. I don't know how to derive the view mode. Not sure there is a way forward.

rozh’s picture

Ctools modal is a great idea. Do you want to commit it, Damien?

DamienMcKenna’s picture

FileSize
4.27 KB

Rerolled.

DamienMcKenna’s picture

FileSize
4.98 KB

Rerolled again. I also removed the part from the README.txt about the overlay.

DamienMcKenna’s picture

Status: Needs review » Needs work
FileSize
51.79 KB
69.14 KB

In my testing this was not working well - it had a tendency to bork the display. For example, it starts like the following:

Before opening the editor dialog.

After clicking the 'Edit field' contextual menu on the pane, the display changes to the following:

After opening the editor dialog.

After closing the dialog the display is still borked.

DamienMcKenna’s picture

Additionally, I really think there should be a way of controlling with dialog is used.

The last submitted patch, 13: fape-n2212495-13.patch, failed testing.

sonfd’s picture

Hello! I was looking to do this very thing, so I applied your patch and was experiencing the same problem with the display. After digging in, I noticed that the page had loaded the default theme as well as the admin theme and this is what was causing the display to be jacked up. Still no solution for choosing which dialog is used, but here's how I got this to work with your patch.

milos.kroulik’s picture

Just wanted to note, that there are another possibilities for a dialog:

Both claim good support of forms.

Perhaps there could be a (sub)module for each integration?

captainack’s picture

FYI integration with the dialog module is practically a one-liner after making sure ajax works (see #2657272: Not compatible with ajax submission).