Needs review
Project:
Compact Forms
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Dec 2009 at 00:43 UTC
Updated:
13 Dec 2009 at 07:04 UTC
Currently forms are selected through a css ID, e.g., user-register-form. For some forms this presents issues, e.g., node-form applies to all node forms rather than forms for specific node types.
Attached patch (versions for both HEAD and D6) adds support for form ids in the form e.g. article_node_form. Approach:
* Change relevant settings form #description to explain both CSS and form_id formats, with examples.
* Extend jquery selectors to include form:has([value=form_id]).
| Comment | File | Size | Author |
|---|---|---|---|
| compact_forms_ids_d6.patch | 2 KB | nedjo | |
| compact_forms_ids.patch | 1.92 KB | nedjo |
Comments
Comment #1
sunUm. Are you really sure? ;)
Comment #2
sunComment #3
nedjoPretty sure, yes ;)
True, underscores are changed to hyphens in the $form_ids variable array, but it's the original $css_ids that is tested in
(isset($form['#id']) && in_array($form['#id'], $css_ids))and that's sent to Drupal.settings:_compact_forms_include_js($css_ids);.To verify that the patch works, put e.g. page_node_form as a value in the configuration variable. On my testing, this triggers the compact forms behaviour for page_node_form.