Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you want to add your own submit button besides "Preview" and "Submit" in node-types form, you normally think you will form_alter and add your button with let's say a weight of 1000 so it sinks. But no, node.module uses theme_node_form() to custom theme this form, so _whatever_ you do, it will render your buttons somewhere that you can't control using weights.
Comment | File | Size | Author |
---|---|---|---|
#2 | mw_50.patch | 1.76 KB | moshe weitzman |
#1 | node_submit_buttons.patch | 1.66 KB | AmrMostafa |
Comments
Comment #1
AmrMostafa CreditAttribution: AmrMostafa commentedThis is a a simple solution to for this simple problem. Very similar to this snipper which is already in node_filter_form():
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedI wish I had looked here before redoing this patch. Anyway, here is a refreshed version. Works as advertised.
Comment #3
Gábor HojtsySimple, straightforward, and with previous practice, so committed.
Comment #4
(not verified) CreditAttribution: commentedComment #5
samo CreditAttribution: samo commentedWas this mod only applied to 6.x?
Comment #6
Gábor HojtsyIt would break backward compatibility on the form, so no way to apply it to 5.x IMHO.