Hi,
First, thank you for this awesome module.
I was wondering : would it be possible to display the fields in "view" mode by default, but with a little link to edit it (Like in your screenshot here : http://drupal.org/node/355438 for the field "multi text thing"), which would open in a modal frame/pop-up via jQuery for instance.
I think this would be the best possible user experience of editing content : view it in its most readable (formatted) way => "view mode", and edit it in place if required, without leaving the page. Icing on the cake, the "view mode" would be instantly updated.
But I really don't know to what extent all this is possible...?
Comments
Comment #1
john.money commentedYou're looking for Modal Frame CCK Editor. It works well (particularly for complex fieldset editing), but not nearly as elegant as this module for single element items.
Comment #2
_paul_meta commentedI used this strategy as a workaround for multi-value fields that editablefields couldn't yet deal with
at some point after updating some modules, it started performing reallly slow .. like 18 second wait time to load. so i abandoned modal frame cck and now use a combination of lightbox2 and editview. my main view has many nodes displayed, with the required field rendered as view only with an edit link, which opens an editview view taking the nid as the argument which is capable of handling a single node's multiple value field. bit of a hacky workaround but it performs well and avoids the need to edit each node individually.
grouping the lightbox links means you can scroll through each of the edit links without closing the lightbox. and a small tweak to the lightbox js code and you can make the main view refresh when you close the lightbox
sorry if this is a bit off topic, but i thought this approach might help people still hoping for multi-value editablefields.
thanks :)
Comment #3
fourmi4x commentedThanks a lot for your feedbacks, I'll try this soon!
Comment #4
andreiashu commentedI just submitted a patch for review here. At this moment it is far from being done but any thoughts are welcome.
Please note that the patch adds support for Modal Frame (CTools) only for text fields at the moment (multivalued textfields work though).
Also, I think in 6.3 branch we have support for multivalued textfields already for the html formatter?
Cheers,
Andrei
Comment #5
andreiashu commentedForgot to mention, after you apply the patch, clear cache and you should see a new formatter: "Editable Modal Widget".
Comment #6
fourmi4x commentedHi andreiashu, many thanks for your patch, it already a great improvement !!
I tested it on text fields and no problems so far.
As you said thoughts are welcomed, here are a few:
- Instead of having the whole text outputed as a link to the modal frame, would it be possible to display a little grey "edit this field" (for instance) next to it ? (Ideally, this would even be a "pen" image)
- I would be interested in having this functionality for various kind of fields, for instance Taxonomy fields with Active Tags widget, Nodereference fields, ... Would it be imaginable to use/start from your code for other kind of fields if I wanted to ?
Comment #7
andreiashu commentedGlad to hear that you find it useful.
At the moment we are trying to think which would be the way to go in integrating EF with CTools plugins, AJAX and exportables systems. As you can see, the patch is just a prototype - in no way it will remain the same in the next few days.
I think the target here is to make it fairly easy for other CCK field modules to provide their own editable as a CTools plugin.
So far I think we are in the right direction but it needs more work.
I would be interested to see your thoughts in trying to generalize this kind of functionality - I'm thinking of an editable fields API which (for example) Taxonomy fields can leverage to provide editables in all kinds of contexts (node view page and views come to my mind).
Cheers,
Andrei
Comment #8
fourmi4x commentedHonestly, I'm still quite a beginner to drupal and development in general, even if I do my best to learn! So I'm not sure what solution would be best to have editable fields work for all kind of cck fields.
Still, I think creating an API may probably be the best solution indeed, thanks to the flexibility it provides. If adapting editablefields module to each type of cck field requires a lot of work, the module will quickly become hard to maintain... Plus it may be easier for the "cck fields modules maintainers" to implement their specific editable widget, if the API is easy to understand.
However, they won't have a strong incentive to do it if the solution is only available for cck text at the beginning ("Why add taxonomy with active tags widget, if no one is going to use it because there is so few field types available?"), so maybe it would be a good idea to implement all basic/core cck field types to give that incentive, in a "basic cck editablefields module", which would be completed by an API.
Hope this make sense, I'm not sure !
Comment #9
krlucas commentedSo, out of the box, I think editablefields should support CCK fields and title and body.
Honestly, so far I haven't been able to (intentionally) break the CTools modal with any CCK field/form I've tested and that includes text, decimal, date, file, image and multi-value fields. (That said I'm accidentally breaking things in dev all the time so don't let that be a sign of real current progress :))
Once we've further glued together Node.module, Form API, CCK and CTools I'm pretty confident this module will provide really solid support for CCK fields without any extra effort by field maintainers or their issue queues (who I bet are focused on D7) or us just be virtue of what they've already told the CCK API. I know I have yet to prove this to @andreiashu!
The problem with other types of node fields is that they don't all share the formatter/widget API or node/database logic so we are talking more code, specific to those modules, needing to be included.
So yeah that's what our API will allow other people to provide and I think it could be minimal--almost not an API as much as a new kind of cTools plug-in. Without talking with @andreiashu much that seems to be where we are going. I imagine it will go through a few major revisions.
@fourmi4x so ultimately, after you choose the "Editable" formatter, you'll be able to choose the formatter for the html/text to be included in the link that you will click on. In Views and Panels this will be just a fieldset that appears below the editable formatter choice (kinda like what happens when you choose "Custom" for label). I think it's reasonable to include extra settings to control where that text appears (inside or outside the link) as well as settings for custom text. Those settings will get exported with the View or Pane.
For full node displays you'll be able to choose the formatter for the inner text (via a new tab under the Display Fields menu). With some form hackery we could support extra settings but I'm hesitant to promise that since overriding the node view with a Panel will let you do the same thing and more, in a better UI, without extra code.
Comment #10
krlucas commentedWe should probably continue the larger CTools discussion at #1144044: CTools integration
Comment #11
fourmi4x commentedWell that looks great to me, can't wait to test that!
Comment #12
mengi commentedPer https://drupal.org/node/2148735, 6.x is longer maintained so issue is closed. If you wish to be a maintainer of the 6.x branch please create a new issue.