D6, Real Estate & Views/Images

skyline5k's picture

This is the first real estate site I've built using Drupal. It's not quite done yet, as I'm trying to tweak a few settings, and could use some help.

First: It's multi-language. English & Chinese. Only one price, RMB. As for views, filtering the language works well. That was actually easier than I thought. However, when I tried filtering the language for a slideshow views using images taken from imagecache, It's not filtering; i.e. both the English AND the Chinese pages are circulating no matter the language selected.

Any advice how to fix this?

Another thing is for the search parameters.

So far, I got district, # beds & # baths. I still need a price range to add to that view. Two dropdowns to choose lowest & highest and for views to display EVERY property in between. I tried to see how the old abandoned "realestate" module did it, but couldn't see where it was added & gave up.

When I get all this working properly, this thing will be as good as done! Any help appreciated!

Comments

OMG.. nevermind. I'm an

skyline5k's picture

OMG.. nevermind. I'm an idiot. The IMAGES works well. I had forgotten that last week, I cloned the image views. It wasn't working because I had a different view altogether running in the chinese block.

Anyways, just need that dropdown thing, and any and all advice to add to this is appreciated!

Cheers!

skyline, if you have some

Garrett Albright's picture

skyline, if you have some programming chops, you may try this method, which I've had some success with: Add two separate exposed filters to the Views. Have one filter by "this value or higher" and have the other filter by "this value or lower." Then, use a hook_form_FORM_ID_alter() implementation to change each field from a textfield to a select (dropdown menu), and populate it with a few iterative values. The user will see dropdown menus where Views intends there to be text fields, but the values will still be passed on to Views for doing its filtering and it will be none the wiser.

Then, use a

skyline5k's picture

Then, use a hook_form_FORM_ID_alter() implementation to change each field from a textfield to a select (dropdown menu), and populate it with a few iterative values.

You lost me at this point. Where do I adjust this? Separate module?

Ah, sorry about that. For

Garrett Albright's picture

Ah, sorry about that. For that part, you either have to be familiar with programming for Drupal, or hire someone who is. :)

There may be a way to implement it solely in modules (without coding), but I don't know of it.

Hi, I am trying to implement

Hi, I am trying to implement something on these lines. I am using cck fields for the content. I tried using search by taxonomy (custom_search module) and provided bedrooms, bathrooms and price as taxonomy terms. I never liked that approach but do not know any way to do it. I saw this post and was wondering as to how do I go about creating a search box with these filters in views.

Thanks
prerns.

http://groups.drupal.org/node

skyline5k's picture

http://groups.drupal.org/node/14590 looks promising actually, though it requires making a module it would seem.

Old issue, yes...

skyline5k's picture

but... I'm still on this part. I created my own module, called views_price, using the code in the link that I modified for my own use. I called this: views_price.module

<?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;
  }

}

http://terascape.net/images/min.jpg - views settings (max is same, except "less than" & _max
http://terascape.net/images/search.jpg the search box
http://d20010.u35.terascape.net the dev site

Trouble is, it won't show, and I don't see what I'm missing. This is my FIRST attempt at this, so could use a little feedback.

Real Estate

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week