Problem/Motivation
Editable Views comes with a single default Display - Table (or "Horizontally Displayed"). Table display works OK for many applications, but when an entity has text areas, or many fields, the display can become unwieldy. Also, editable views is a great way to provide case by case entity edit screens without having to emply hook_forms, but it would be nice to have the "Unformatted" style which more closely resembles the default Drupal edit screens (or "Vertically Displayed".
Image 1:Horizontally Displayed Fields with Standard "Editable Table" Views Display.
|
Image 2:Vertically Displayed Fields with New "Editable Unformatted" Views Display.
|
Proposed resolution
Create a Views Display plugin to add unformatted display. The attached patch does this by simply copying code wholesale from the table views, but extending the class "views_plugin_style_default" instead of "views_plugin_style_table". The plugin definition mirrors the Views plugin style "default".
Remaining tasks
Preliminary testing by patch author- Wider testing by others
- Review by module maintainer
User interface changes
Adds the option "Editable Unformatted" to Views Display selector.
API changes
none.
Data model changes
none.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | editableviews-style-unformatted-2579113-26.patch | 15.2 KB | robertwb |
| #23 | editableviews-style-unformatted-2579113-22.patch | 15.39 KB | robertwb |
| #8 | editable-views-unformatted.png | 13.31 KB | robertwb |
| #8 | editable-views-table.png | 12.12 KB | robertwb |
| #7 | editableviews-style-unformatted-2579113-07.patch | 15.87 KB | robertwb |
Comments
Comment #2
robertwb commentedComment #3
robertwb commentedComment #4
robertwb commentedUpdated patch to be refcognize a column level option to "suppress_value". This is therefore compatible with proposed patch to suppress value (https://www.drupal.org/node/1980238). This modification will NOT REQUIRE #1980238, but allows for it or some other patch that sets the config option "suppress_value".
Comment #6
robertwb commentedUpdated patch from #4 to add file back in (#4 accidentally used "git diff" instead of "git diff --staged"). Also, patch in #4 was erroneously named -03.
Comment #7
robertwb commentedPrevious patches had included the new plugin files, but were not diffed properly to include code as well. Attached patch uses "git diff HEAD" to produce a patch that contains both file and code updates.
Comment #8
robertwb commentedComment #9
robertwb commentedComment #10
robertwb commentedComment #11
robertwb commentedGraphics editing.
Comment #12
robertwb commentedComment #13
robertwb commentedComment #14
robertwb commentedComment #15
robertwb commentedComment #16
robertwb commentedComment #17
robertwb commentedComment #18
robertwb commentedComment #19
robertwb commentedComment #20
nwom commentedThanks a lot for the patch! It works perfectly. The only thing I noticed was there was some commented out dsm lines, and the following was shown when applying it via drush_iq:
Comment #21
robertwb commentedThanks @NWOM - bad habit! - I will clean that up and re-apply.
Comment #22
robertwb commentedAttached is a new patch with devel message statements removed. Thanks again @NWOM for the review.
Comment #23
robertwb commentedComment #24
nwom commentedAwesome. Just noticed something else. The .info file is referencing the following non-existent file:
+files[] = handlers/editableviews_handler_field_entity_field_edit.incComment #25
petednz commentedthanks for the work to try and deliver this which looks like a good addition. should I be testing the patch in #23 or is there another one just waiting this teeny nudge?
Comment #26
robertwb commentedHey @petednz - thanks for bringing this up -- just removed the extra files line mentioned in #24 - patch attached.
Comment #27
mrpeanut commentedPatch from #26 applies and works great!
Comment #28
robertwb commentedCan we get an RTBC here?
Comment #29
petednz commented@robertwb - thanks for progressing this, and to MrPeanut for testing/confirming. I will see if we can get it tested too in next few days.
Comment #30
robertwb commentedThanks @petednz!
Comment #31
petednz commentedConcur that when applied and cron cleared i see a new option in Table Settings for Editable Unformatted, and that this setting render the fields vertically.
many thanks
I assume the issues i have with eg the label showing twice if i choose 'Use handler label for form element" is unrelated to this patch.
Comment #32
petednz commentedComment #33
nwom commentedRules don't seem to trigger when content is updated. Anyone else having this issue in combination with this patch?Edit: Nevermind, the rule is triggering as expected. After enabling debugging on rules I was able to verify this. Please disregard this comment.
Comment #34
hochh1707 commentedJust found this patch and implemented it on a site I'm building. Very useful. Thanks!
Comment #35
nwom commented#26 still applies cleanly to the newest dev.
Comment #36
khalor commentedYep, can also confirm #26 still works against current dev
Comment #37
assembledbits commented#26 works, but I must be missing something... this allows Anonymous users to edit fields. There are no permissions?
Comment #38
robertwb commented@assembledbits - I don't think that this particular mod affected permissions as it is only a display plugin, and is a near carbon copy of the original (but if I'm wrong I will fix it). That said, it should use honor all Views permission options as well as any others that are built into the Ctools field form components (if there are any?). FWIW - Views by default have no permissions, but it is a best practice to always explicitly set permissions on Views.
Comment #39
sethpkendall commentedAfter patching the module I see the "Editable Unformatted" option in the format choices on my views but selecting it and clicking "Apply" does nothing. The format remains on the previous selection. No PHP errors, no nothing. Any suggestions?
Comment #40
robertwb commented@sethpkendall - clear caches? Haven't seen this effect otherwise.