I'm trying to insert a form element with hook_form_alter()
, and then rearrange the form elements so that the new form item appears at a particular point amongst the existing exposed filters.
I've tried adding #weight
of 0
to all existing items and then #weight
of -1
to the new element, just to see if I can have any influence on the form item order at all, however I don't seem to be able to affect it.
EDIT: In addition I'm getting kinda weird behaviour regarding the container of the Form element. I'm adding my form element as a new array element at the root of $form
, however it is be rendered inside the element <div class="views-exposed-widget views-submit-button">
rather than getting it's own container, which seems like either a bug or I really am doing something wrong!