3

I'm trying to modify an exposed view form by adding some additional markup. My current code looks like this:

  if ($form_id == 'views_exposed_form') {
    if ($form_state['view']->name == 'products_page') {
        // $element = array();
        $form['filter_by']['#type'] = 'item';
        $form['filter_by']['#markup'] = '<h2>Filter by:</h2>';
        $form['filter_by']['#weight'] = -10;
        // $form = array_merge($element, $form);
        $form['solution']['#options']['All'] = 'By Solution';
        $form['technology']['#options']['All'] = 'By Technology';
        $form['platform']['#options']['All'] = 'By Platform';
        $form['brand']['#options']['All'] = 'By Brand';
        $form['category']['#options']['All'] = 'By Solution';
    }

    dpm($form);
  }

Now I'm trying to move the 'filter_by' element to appear first, before every other element, so I attached a weight value of -10 to it. However, the element is being added to the container that the submit button would normally be found.

enter image description here

I'm completely confused... any insight?

1 Answer 1

5

Well then... apparently it's a weird lopsided solution that is necessary. See comment #10 here http://drupal.org/node/893392.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.