addendum to this, but different presentation: http://drupal.org/node/1113698

Instead of using a custom mod, perhaps this bit of code can go into a template?

I tried creating views-view-list--property_search.tpl.php in my "newsflash" theme. property_search instead of the example "foobar" being the name of the View. Similar code used:

<?php
// $Id: views_price.module,v 1.22 2011/04/02 19:53:27 sun Exp $

/**
* Alter the form to display dropdowns for price range
*/
function mainland_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'views_exposed_form' :
      $form['submit']['#value'] = t('Search');
      $from_options = array(
        '' => t('Any'),
     '5000' => t('5,000RMB'),
      '10000' => t('10,000 RMB'),
      '15000' => t('15,000 RMB'),
      '20000' => t('20,000 RMB'),
      '30000' => t('30,000 RMB'),
      '40000' => t('40,000 RMB'),
      '50000' => t('50,000 RMB'),
      '100000' => t('100,000 RMB'),
      );
    $to_options = array(
        '' => t('Any'),
     '5000' => t('5,000RMB'),
      '10000' => t('10,000 RMB'),
      '15000' => t('15,000 RMB'),
      '20000' => t('20,000 RMB'),
      '30000' => t('30,000 RMB'),
      '40000' => t('40,000 RMB'),
      '50000' => t('50,000 RMB'),
      '100000' => t('100,000 RMB'),
       '100000' => t('100,000 RMB plus'),
      );
      $field_propprice_value_min = array (
        '#type' => 'select',
        '#multiple' => false,
        '#required' => false,
        '#options' => $from_options,
        '#default_value' => 'Any',
      );      
      $field_propprice_value_max = array (
        '#type' => 'select',
        '#multiple' => false,
        '#required' => false,
        '#options' => $to_options,
        '#default_value' => '$1,000,000 plus',
      );    
      $form['field_propprice_value']['min'] = $field_propprice_value_min;
      $form['field_propprice_value']['max'] = $field_propprice_value_max;
      $form['field_propprice_value']['min']['#title'] = t('from');
      $form['field_propprice_value']['max']['#title'] = t('to');
      break;
  }

}

Not as mentioned in the code part of my custom module, but a view theme instead. I'm using advanced help, but I still can't make heads or tails of where to get this going. Rescanning template files doesn't bring up the new template.

Again, I ask, what am I missing here? Gotta be something simple.

Comments

R.Hendel’s picture

Status: Active » Fixed
Issue tags: +dvcs11

Hallo,
is your request still open?

It is for quite a long time undiscussed. So I will set it on fixed to clean the queue.
Please feel free to reopen it, if you have any further questions. Otherwise it would be closed automatically after two weeks.

Status: Fixed » Closed (fixed)
Issue tags: -dvcs11

Automatically closed -- issue fixed for 2 weeks with no activity.