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.
It is currently impossible to have multiple node forms on one page due to fixed IDs. node.js relies for example on 'fieldset#edit-revision-information' and 'fieldset#edit-author'.
When you have two node forms on a single page node.js will work for the first.
Comment | File | Size | Author |
---|---|---|---|
#5 | 955610.patch | 14.45 KB | casey |
#2 | 955610.patch | 10.42 KB | casey |
Comments
Comment #1
casey CreditAttribution: casey commentedAnother example: comment_form_node_form_alter() contains fixed IDs '#edit-comment-0' to '#edit-comment-2'
Comment #2
casey CreditAttribution: casey commentedComment #3
moshe weitzman CreditAttribution: moshe weitzman commentedWould this make it harder to target node forms via css/js? Do all node forms have a common class?
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedWould this make it harder to target node forms via css/js? Should all node forms have a common class?
Comment #5
casey CreditAttribution: casey commentedNo not at all.
Reroll uses classes instead of names which is even more generic. Also altered menu.js' Drupal.behaviors.menuLinkAutomaticTitle to make it work for multiple node forms.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedOK, lets do this.
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #9
sunShould have been .once(), not .each().
Powered by Dreditor.