Exposed Filter Field #weight has no impact on ordering

Is there a way to change the order of exposed filter fields by hook_form_alter’ing their weights? I’m trying to add a few new form elements with hook_form_alter and can’t get them to show up anywhere except the end of the for.

The other alternative I come up with is perhaps a plugin that just adds blank form elements to filters, is such a thing feasible?

$form['#info']['filter-byline-names']['value'] = ‘abc’;

$form['#info']['filter-byline-profile-type']['value'] = ‘efg’;

where abc, efg are the newly added form element

$form['abc'] = array( '#type' => 'textfield' , '#title' => 'ABC' , ); $form['efg'] = array( '#type' => 'select' , '#title' => 'Profile Type', '#options' => array('asdasd','rajveer','gangwar'), );


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

WordPress.com.

Up ↑

%d bloggers like this: