Private real estate sales website

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
JmsCrk's picture

My business has recently finished developing a private real estate website in drupal, this has been our largest drupal job so far and involved writing a few custom modules and a lot of learning about more complex modules and features.

Here's the site: http://www.housebroker.com.au

Check it out, comments welcome.

Comments

Search

rovo's picture

Hi,

I would love to know how you created your advanced search page. I am trying to do the same for a small real estate site. Your site looks great, any particular modules you recommend for putting one together?

Thank You
Robert Dean

Hi Robert, I made the

JmsCrk's picture

Hi Robert,

I made the advanced search as a module that searches through the database itself, totally independently of the built-in search module. The properties are a new cck content type so they're held in their own database table. Because most of the search fields are quite structured it was easy enough to make the form_submit function so that it builds an appropriate SQL query to search that table and return the results. If you're interested I can send you the code, but it's way too hacked and hard-coded to release. Maybe I could write a tutorial about the process for the docs? In fact, there might already be one, I haven't checked.

Otherwise the modules are fairly standard:
cck
contemplate (although I wouldn't do this again)
ecommerce3
login_destination
logintoboggan
menu_per_role
pathauto
tac_lite
token
views

Plus custom modules to do:
Advanced search
Author contact (released as module now)
Featured properties
Pay2publish <- I called it this but it's unrelated to the existing pay2publish module (it was too complex)
node_images <- started with the original node_images module but totally hacked

i'm about to make my own

mcp-gdo's picture

i'm about to make my own custom search of CCK fields.
But if your submit code is available, I would gladly use it.

http://www.Motorology.com - Motorology network
http://www.MarcelPamphile.com - My personal Website

http://www.TrinidadWebmaster.com - My webmaster services
http://www.Motorology.com - My group of business websites and services
http://www.TrinidadAndTobagoFootball.com - Trinidad and Tobago Football

Return the results

Matthew_wright's picture

Hi JustJamesAus

I am a newbie to Drupal and almost finished the same process - I am having trouble in the drupal the 'Return the results' stage of my form module. I have the form values to submit but how do I get the submit function to return a list of nodes to the redirect?

I have put together the rest of the site including my own real estate listing module.

Regards

Matt Wright

Hi Matt My search form is

JmsCrk's picture

Hi Matt

My search form is set up to action to a URL that has an associated function - that way i can use the same action URL for the quick search and advanced.

Form item:

$form['#action'] = url('search/results');

And the callback from that page then has this near the bottom of the function:

    //...code to perform the search...

    // add each node in teaser format to output
    while ($node = db_fetch_array($result)) {
        // dprint_r($node);
        $nodes .= node_view(node_load($node['nid']),true);
    }
    // ..more lines missing...

$output .= $nodes;
$output .= theme('pager',NULL,$pager_total_items,0);
return $output;

Does that help?

Great work

Matthew_wright's picture

Hi JustJamesAus

I understand what you doing - just need to make it work with my code.

The code above is very similar to my code for displaying listing from static links etc.

I need to get the $form['#action'] = url('search/results') working and the receiving function working! (am using Drupal 6).

Did you use the $form['#redirect'] at all or did the $form['#action'] circumvent this?

Regards

Matt Wright

Hi Matt - I'm using Drupal 5

JmsCrk's picture

Hi Matt - I'm using Drupal 5 and I think the menu system is something that has changed (?)

In my form I have:

$form['advanced']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Search'),
        '#prefix' => '<div class="action">',
        '#suffix' => '</div>'
    );
    $form['#redirect'] = false;
  $form['#method'] = 'get';
  $form['#action'] = url('search/results');
  $form['q'] = array('#value' => '<input name="q" value="search/results" type="hidden" />');
    return $form;

So I'm turning off 'redirect' and using the action to go to the URL in question. The variables are sent as GET so the page can be bookmarked.

And here's my module menu implementation:

function propertysearch_menu() {
  $items = array();
  $access_content = user_access('access content');
   
    $items[] = array('path' => 'search',
        'title' => t('Advanced Search'),
        'callback' => 'drupal_get_form',
        'callback arguments' => array('propertysearch_search_form'),
        'access' => $access_content
        );
    $items[] = array('path' => 'search/results',
            'title' => t('Search Results'),
         'callback' => 'propertysearch_search_results',
          'access' => $access_content,
          'type' => MENU_CALLBACK
        );
    return($items);
}

Then I make the function called 'propertysearch_search_results' that is called when that URL is visited, it returns the values as previously posted above.

I haven't done the same thing with drupal 6 yet, so I'm not sure exactly how it will work - but it should be similar...?

Thx for all your help

Matthew_wright's picture

Hi

Thx indeed for all your help with this.

After much reading and hair pulling of the 6 form API, I have for the short term bypassed the api and constructing the search forms on the individual search pages I am keeping the module for the receiving page. The form 6 api has been excellent for the processing & the inputting of data to the database but when it comes to extending its use to displaying search results I found the it difficult (getting into all sorts of issues with the passing of form objects as associative arrays etc).

I will revisit the search module at a later date when I better understand the api. In time I would like to post a module targeted for real estate agents. As an aside, in most of my reading the general consensus was to use a multistep form in 6 to display the results from a form search query, I believe your methodology is better.

Anyway thx again and will post my end result here for your viewing! We are using a modified professional drupal template for the design.

Regards

Matthew Wright

Listings

rovo's picture

I also really like your listings of the properties. They are so simple and clear. Perfectly laid out, and it is great how you tied the contact form(Author Contact module?) to the listing agent right there on the same page. You say you wouldn't use contemplate again? If that helped you create those page layouts, I'd say it worked out pretty good. :o) . I would love to see the advanced search code you came up, though I am a bit of a newbie and not sure I would now what to do with it, I could give it a try.

One suggestion for the advanced search query; you can choose 'for sale' or 'for rent' , then down below you choose the price range. It would be nice if you just had one set of price ranges that applied to either the 'for sale' or 'for rent' choice. I thought that was a little confusing for 2 seconds. Not a big deal.

Great job, the icons for bedrooms and bathrooms is a nice touch also. Thanks for sharing your experiences on how you delivered this site.

I'm waiting for some of

mcp-gdo's picture

I'm waiting for some of those modules in Drupal 6.0

for example: node_images

Marcel
http://www.weightjournals.com - Weight Journals

http://www.TrinidadWebmaster.com - My webmaster services
http://www.Motorology.com - My group of business websites and services
http://www.TrinidadAndTobagoFootball.com - Trinidad and Tobago Football

just in case

atpaust's picture

The website looked good. If a newer version is developed based on Drupal 6.0, or need some help for collaboration on that, please let me know.

Daniel
www.aozoo.net

Thanks also

JmsCrk's picture

Thanks Daniel. There's no v6 version on the horizon - it's working fine in D5 so the client won't want to change unless there's a problem, or a D6 feature they need.

I have had a request for the author contact module to be ported to D6, I haven't had a chance to get to it yet and I haven't done much D6 development yet at all...

Very nice work. I came to

maxaud's picture

Very nice work.

I came to this page via google as I'm looking to make a FSBO portal @ FSBOinCanada.com/.ca
Is the whole package available to use or is it purchaseable? Profit sharing?

Let me know, very interested.

Thanks Maxaud

JmsCrk's picture

Thanks Maxaud. I'd be happy to discuss purchase or profit share - I've PMed you my email address so stay in touch.

Pictures

sullyman's picture

Hi James,

Hope you are well. I just came across your site and it's fantastic. I'm new to drupal and not a programmer at all so trying to learn as much as i can.

Can you tell me who you aligned the thumbnail images inline? I can't find any tutorials online at all regarding how to show images in this way. I have tried using lightbox and can get thumbnails to display vertical.

Any help would be greatly appreciated.

Regards from Ireland
Sully

Need a Real Estate Site

fernman's picture

Hi JustJamesAus; your site is fantastic ! I need to put together a real estate site and would like to know about your purchase options..

Thanks

This is exactly what I am trying to do

Thomas2z's picture

James,

You site is great! I am new to programming and also Drupal. I am attrempting to setup a site for my small HOA that includes a page for Sales & Rentals. I do not need it tied into an MLS system, and showing the sales agent is a fantastic plus. Your site has everything functioning perfectly.

I have built CCK fields and entered in some homes data, but it looks nowhere near this good. I would love to make it look this good, is your submit code is available? Any help would be appreciated.

Sincerely,

Thomas

Real Estate

Group notifications

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

Hot content this week