The form groups which are now collapsed by default are a huge improvement on the content creation page. However, it would be better for usability if the "optional" groups (those collapsed by default) were moved to the bottom of the page (or lower on the form) now.
For example, the "authoring information" and "publishing options" are collapsed and should be optional fields if reasonable defaults have been entered in the workflow. Having these form groups at the top no longer makes sense. I know that when I create content, the publishing options is the last thing I do after I know how the content is shaping up so having these options nearer the submit button makes more sense.
I would suggest to move them just below the "log message" field.
Comment | File | Size | Author |
---|---|---|---|
#38 | _34920_weights_0.patch | 11.39 KB | Morbus Iff |
#37 | _34920_weights.patch | 12.17 KB | Morbus Iff |
#30 | node_weight_2.patch | 14.39 KB | webchick |
#28 | node_weight_1.patch | 10.66 KB | webchick |
#26 | node_weight_0.patch | 7.91 KB | webchick |
Comments
Comment #1
tangent CreditAttribution: tangent commentedHere is a patch. I chose to give the admin options a weight of -4 because the "body" item is at -5. I also had to modify theme_node_form() because it was outputing the admin options first regardless of the weight parameter. Hopefully I got everything right.
Comment #2
tangent CreditAttribution: tangent commentedAfter a bit more experimentation, I realize that the default weight is above the title field and that some modules fields are currently weighted above the body field. This doesn't seem correct to me.
It is my feeling that the title and body fields are the primary fields on this form and that all others are optional. As such, they should be placed right at the top and that additional fields should be placed below them unless they have a good reason to come first.
This patch changes the weights of the title and body fields so they appear nearest the top and the default weight to appear below the admin options.
With this patch, the path module, for example, is weighted such that it will appear directly after the body field (if no other modules are installed) and before the admin/publishing options.
Comment #3
Crell CreditAttribution: Crell commentedI'm not sure why but the patch wouldn't apply cleanly for me. It needed me to manually specify the file to be patched. I've attached a reroll of it that changes nothing in the code, just in case others have the same problem. :-)
As to the patch itself, I like it with one caveat. I'm not entirely sure how the filter system works, I confess, but it applies primarily to textareas. Therefore, it makes sense to me for the filter selector to be immediately after the textarea to which it would apply rather than "somewhere down the page" as this patch would put it.
Does that make sense? Or did I miss some memo about how the filters are handled in 4.7? :-)
Comment #4
tangent CreditAttribution: tangent commentedI am not sure what you mean by a filter selector (haven't needed such a feature so I'm ignorant here) but I'm guessing that it is a module added field which means that the module need only specify a weight for the form item to override the default weight. This should not be an issue.
Comment #5
Dries CreditAttribution: Dries commentedThe filter selector (filtered html, php code, full html) logically belongs to the textarea (because it only filters only the textarea). After applying this patch, the forum topic edit form looks really weird.
Comment #6
tangent CreditAttribution: tangent commentedThe forum topic add/edit forum looks the same as for any other node type on my test setup. Do you have any other modules enabled which are adding form fields which are affecting the appearance? Can you be more specific about how it looks wierd?
It may be that the forum module needs to be patched as well though I am not seeing anything which needs changing.
Comment #7
Thox CreditAttribution: Thox commentedI'm in favour of the groups moving somewhere out of the way. I've not used WordPress in a long time, but I remember they put these kind of fields below the submit button, as they are so rarely changed.
Comment #8
tangent CreditAttribution: tangent commentedHere's a screenshot of my forum topic edit form with the patch.
Comment #9
Dries CreditAttribution: Dries commentedAnnotated screenshot attached.
Comment #10
tangent CreditAttribution: tangent commentedThe "Input format" fieldset is currently collapsed by default. I don't recall if it always comes directly after the body field without this patch but I don't think it always does. Is this something I should add to the patch?
Comment #11
Crell CreditAttribution: Crell commentedExactly, tangent. :-)
Look at the fieldset labeled "Input format". It has a single set of radio buttons in it, which apply only to the big textarea above. However, said radio buttons are now far-removed from the textarea to which they apply, and collapsed by default. That's a problem. They should be placed with the textarea, since that is what they apply to.
As I've said elsewhere, I think we're getting far too carried away with the coolness of collapsable fieldsets. We should not be defaulting them to collapsed unnecessarily, yet we seem to be doing so more and more. That's bad.
+1 for moving the comments, attributes, and authorship fieldsets down and collapsing those. They're rarely used and make sense anywhere. -1 for making the input filters removed from the textarea and for collapsing it by default needlessly.
Comment #12
tangent CreditAttribution: tangent commentedRE #9
Forum topic form fields are a specific case and it may be that other modules will have similar issues. I had hoped that the fields for every module wouldn't slow this down. In my opinion, the placement of the taxonomy/forum selector deserves its own issue but if you say that it should be the first form field or should have a weight of N, I'll patch it.
Comment #13
tangent CreditAttribution: tangent commentedIn addition to the previous changes (different default weights, etc.) this patch makes the following module changes.
1. Makes the filter module "Input format" fieldset not collapsible and with a weight one less than the body field so that it follows directly after.
2. Places the path module "Path alias" field inside a fieldset and collapsed by default.
3. Makes the upload module "File attachments" fieldset use the default weight so that appears next to other other fieldsets and not after the "Log message" field.
This patch does not address the forum module concerns with the "Forums" selector placement or the forum topic "shadow" checkbox placement. From a quick look, the forum module doesn't specifically place the taxonomy selector and relies on the taxonomy module. Having this field placed in a different place than normal taxonomy selectors are placed would require extra code which I will leave to the forum module maintainer. Further, it is my feeling that the "shadow" checkbox (as it is referred to in the code) should be placed into a fieldset next to the taxonomy selector as this field seems fairly dependant on the former.
Comment #14
tangent CreditAttribution: tangent commentedWhen posting a forum topic from within the forum module (as a typical forum user is accustomed to doing) the topic selector will be prepopulated with the topic the user is current viewing so under normal circumstances this would be an optional field.
Comment #15
Crell CreditAttribution: Crell commentedI wasn't saying that it shouldn't be collapsable. Most fieldsets should be collapsable. But it shouldn't be collapsed by default.
There's actually a discussion of this in another thread right now:
http://drupal.org/node/30038
Comment #16
Crell CreditAttribution: Crell commentedOK, actually tried the latest patch now. :-) A few comments.
1) Overall, I like.
2) As I said above, I'm in favor of the input format fieldset being collapsable, just not collapsed by default.
3) If we're collapsing everything already, I'd be in favor of putting the log into a fieldset and collapsing it. Honestly, I doubt I'll ever use it.
4) With path alias now not having a proper label before it, it should be a lot easier to put the
$base_url
before it to deal with the UI issues discussed a few weeks ago. :-) Something to think about once this patch goes in (and I hope it does).5) As someone mentioned, what about putting all of this rarely used stuff below the submit buttons? Or would that be just too weird for Drupal? (If so, that's fine.)
Qualified +1 from me, with the caveats in notes 2 and 3. Those should be trivial to change unless someone else objects.
Comment #17
tangent CreditAttribution: tangent commentedIn addition to the previous changes, this patch changes the following.
1. Puts the "Log message" field of the book and page modules into a fieldset and collapses it by default.
2. Makes the filter module "Input format" fieldset collapsible and expanded by default.
Note that I could go either way on the input format fieldset because it's an option which has a high chance of being used. I only make the change since Crell suggests it.
As for the "Log message" field, I don't believe that this issue or patch should make decisions about every module. I'm not even sure what the intended purpose of this new input is so, again I only make this change because it is requested. I suspect I'd be even happier if the input was removed (or hideable) altogether but that's for another bug.
Finally, I'm not sure how we want to handle single optional form items which have been moved into their own fieldset just so they can be collapsed. I chose the route of using their
#title
attribute as the label of the fieldset and leaving the element title blank but this may be inappropriate for some.Comment #18
tangent CreditAttribution: tangent commentedSomeone review this issue or vote on it. This should hit 4.7 but it's being ignored.
Comment #19
Robin Monks CreditAttribution: Robin Monks commentedMark it correctly...and they will come...
+1 for the feature, couldn't do testing at this time.
Robin
Comment #20
Crell CreditAttribution: Crell commentedHey, I've been busy this week and I needed to rebuild my CVS install first. :-)
We could probably argue all night about the exact order of the various fieldsets, but I'd say it's acceptable as it is now. The most important features (input filter near what it filters, nothing above the node itself, rarely used stuff hidden) is all in place.
Code looks clean. I would have broken the field arrays onto more lines, but that's just my preference. Everything complies with coding guidelines as far as I can tell.
+1 functionality, +1 coding style. Let's get this into 4.7!
Comment #21
Dries CreditAttribution: Dries commentedCommitted to HEAD.
Comment #22
tangent CreditAttribution: tangent commentedIt seems that the changes to filter.module didn't get applied with the patch. The 'Input format' fieldset is now collapsed and placed randomly amongst the other optional fieldsets contrary to what I understood the desired result to be.
Attached is an updated patch for filter.module to rectify this.
Comment #23
Dries CreditAttribution: Dries commentedCommitted partially.
Comment #24
webchickSorry, but this patch drives me absolutely batty as it does not actually do what it says it does.
Unless weights are set on every single form element aside from title and body (which means lots of extra typing), these optional settings end up showing up smack in the middle of the form, totally breaking continuity (form element weights by default start at 0). Additionally, starting weights for title and body of -18 and -17 are not intuitive... they should probably be something like -15 and -10. This would allow people to interject form elements between the title and body fields (see: book module, where the Parent element used to be between title and body but now is after body.)
Here is a patch which attempts to solve these issues by moving those optional settings below the submit buttons as suggested by Thox. I've placed a 5-weight increment between all of the weights set by node_form, to facilitate form alteration (yes, decimals can work too, but a lot of people are unaware of this).
New weights are:
title: -25
body: -20
preview: 20
submit: 25
delete: 30
node author information: 40
node options: 45
all other nodeapi additions: 50
This has the extra advantage that other collapsed fieldsets on specific forms are kept separate from the optional fields which are part of every form.
Finally, I've removed the fieldset around "log message" in page and book, for two reasons:
1. This is essential, particularly for book.module, and doesn't make sense to leave it in page but not in book and story (which was already like this).
2. Logs were not getting a default value after this patch because it's looking for $node->log, not $node->message. $node->log matches what's in the database, so I changed $form['log'] back to the actual textfield.
Any comments appreciated.
Comment #25
eaton CreditAttribution: eaton commentedNice, webchick. I'd still lean towards -5 and 0 for title and body, implying that 'body' is the center point around which all other elements revolve. That way, form customizers could use negative values to stick things between 'title' and 'body', and normal numbers to stick things after body. But I think functionally your patch will fix these issues.
Comment #26
webchickOk, let's try this one on for size!
Makes the title and body weights -5 and 0, respectively. In order for this to work I had to set the initial counter of form elements in form.inc to 1 instead of 0 (otherwise this would've put the input filter box below the first element to follow body).
Comment #27
tangent CreditAttribution: tangent commentedThanks for grabbing this issue by the horns webchick. I admit that I was treading blindly when choosing the weights to assign things. I couldn't tell exactly what the intent was based on the existing weights and didn't see any documentation which clarified it so I just tweaked the numbers the best I could.
Your comments and the direction you're taking this look good to me.
Comment #28
webchickNo problem, tangent! It's a good idea, just needs a bit of tweaking. :)
New patch. This one:
1. Fixes the location of parent in book.module which was relocated to the top of the form rather than below title with the last patch (though I personally like it better at the top since it jives with forum.module)
2. Removes the log message field from story module, which was accidentally put there during the forms API conversion (pointed out by Thox)
3. Makes the menu and path collapsible fieldsets behave like upload module's.. if there is a value stored there, it will auto-uncollapse it. (also pointed out by Thox)
Comment #29
Thox CreditAttribution: Thox commentedCouple of screenshots for people that would like to see: (They're slightly out of date because webchick posted another patch which removed the log message textarea, but it emphasises the difference this patch has made)
For comparison I also uploaded a screenshot of the "expanded"/advanced wordpress write screen.
And now some general comments:
Oh, almost forgot: +1, that patch works very nicely.
Comment #30
webchickOk, here is an alternate approach.
Options are now uncollapsed fieldsets, condensed into two collapsible and collapsed fieldsets:
1. Administrative options: this contains Authoring information and Publishing options (only accessible by people with administer nodes privileges)
2. Post options: this contains any extra options added via nodeapi hooks (comment settings, file attachments, etc.)
Both fieldsets are collapsed upon initial page load:
http://webchick.net/soc/node_weight/node_weights_collapsed.png
Then you can open one or both fieldsets if you need to:
http://webchick.net/soc/node_weight/node_weights_admin_expanded.png
http://webchick.net/soc/node_weight/node_weights_both_expanded.png
I think this will help with the "Submit button isn't where I expect it to be" problem, because the user must click on the fieldset title itself in order to expand it, which means he already looked at the Submit button as his eye was glancing down the page, and will also know that he can click it again to collapse it, after which time the Submit button is very visible. (this is the theory anyway ;))
And sorry, Thox, I did not understand this:
> I should make a separate issue for this: "URL path settings" does not mix with "URL path alias won't work".
Comment #31
webchickOh I see now. The name of the path input box and its description below don't match. I actually think this is good as-is, personally... the box is asking for a path, but the thing you're entering is a path alias. But yeah, please start a separate issue for this because I know it was hotly debated on the dev mailing list a few weeks ago. :)
Comment #32
Thox CreditAttribution: Thox commentedThis new patch seems to be a step backwards to before collapsing elements (which may or may not be bad). I don't like it because it does not appear to let me add controls outside the new "post options" fieldset.
I agree that some controls could appear in a group of post options below the form, but drumm pointed out that other controls (his example was attachments) should/could go back to the top.
Comment #33
webchickOk. I am not sure what to do about this issue of wanting to stick certain form options in the form, others below it. I discussed this on IRC with chx and he said one way might be to allow Node's $form array to be passed into hook_nodeapi and hook_node for easy alteration. Based on Dries's announcement about 4.7 RC and freezing of APIs, this is not really an option.
Another option would be to rely on some sort of naming convention (for example, naming an element $form['nodeapi_options']['foobar'] = array(...) or $form['nodeapi_author']['foobar'] = array(...) or $form['nodeapi_form']['foobar'] = array(...). Then in node_form, perform a check during adding nodeapi form elements whether the form element's key matches nodeapi_* and if so, stick it in the appropriate place (publishing options, author options, or inside the form itself). If not, then it gets appended to the bottom of the form with the other options.
All I know is that the current weight problems really need to be addressed. :P I don't really care which approach is used, but these fields *can't* appear in the middle of the form where they are currently. This business of how to inject form elements into node_form seems best handled by a separate issue.
Comment #34
webchickAssigning this to myself so I don't lose track of it again.
Comment #35
webchickUnassigning self, won't have time to work on Drupal-ish stuff until about 2006. :( But this does need sorting. Hope someone can pick up where this left off. Patch will need to be re-rolled + re-thought.
Comment #36
Morbus IffComment #37
Morbus IffUpdated patch for HEAD, based on #28, with some of my own tweaks:
About my changes:
Comment #38
Morbus IffUpdated to today's HEAD, and no CVS $Id$ thingies.
Comment #39
webchick+1. PLEASE get this in, for my poor sanity. ;) Now all the 'extra' stuff correctly appears at the bottom of the form as it should (before the buttons).
Note: Once in awhile the input format will appear above the textarea for which it's intended, but that's due to a separate issue which you referred to above.
Comment #40
webchickAlso, to summarize why this is "a good thing":
- Now that default weights both a) make sense and b) are predictable, it means that the forms API is much more flexible for people to insert extra fields wherever they want when altering a form.
- Contrib modules that add many extra fields no longer have the "optional" stuff sitting smack in the middle of the form.. rather, it's pushed down to the bottom where it belongs.
- The form follows the expected flow without resorting to having to hard-code the weights of all of your fields.
Comment #41
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #42
(not verified) CreditAttribution: commented