Jump to content

Property website - structure advice


SamC
 Share

Recommended Posts

I am building a little demo site with properties to try and get some search functionality going (this may become a real project but even if not, it's good to try something more difficult than I'm currently doing).

Property
 - Type (residential/office/medical - predefined options list)
 - Area (integer - sq ft)
 - Location (number, street, town, county, postcode)
 - Image (image field)
 - Google map with marker

Search (dropdowns x 4 with submit button)
 - Type
 - Location (town only)
 - Min area (sq ft)
 - Max area (sq ft)

Now the top two search dropdowns only really need to list data which actually exists in the system, I don't see much adding a bunch of predefined towns only for the search result to come back empty if no buildings match. Maybe some logic to check every page of type 'building', get town, add to list, if town is already in the list, don't add and also maybe even a (3) or (4) or whatever next to towns to show how many buildings are available.

I want to set it up so the address data can be entered when creating a 'building' page, but also used to populate the town dropdown, but also the address to be used to show a map marker where the building is physically.

I was thinking I could use fields (a single string might be input incorrectly, missing comma or something, possibly making post processing more tricky):

1) addressNumber (integer)
2) addressStreet (string)
3) addressTown (string)
4) addressCounty (dropdown of all UK counties)
5) addressPostcode (would this be an integer or a string?)

Seems I'm a bit stuck at the first hurdle. I'm concerned that setting up the fields wrong at the beginning could mean a lot of manual work later on so thought I'd ask for some advice first. Once I get the data structure sorted, I can create a few dummy buildings and then get to work on a page which lists ALL buildings (in my case home.php), then a search form (goes to search.php) will filter the results. It's like the skyscraper demo site which I can use for reference.

I see however, that skyscrapers uses a google map to get the address after typing it into a single text field. I need a map also but this may not be the best solution for me as each building page needs to output certain details ie. TOWN: addressTown (which would link to search page to show all other buildings in this town). Would this not be easier if each part of the address was split up rather than a single field? I could maybe dynamically add the map marker (from the address fields) on the page itself when the building page is rendered. Not sure about this either.

Hopefully I'm making some sense here. Never built anything like this before so any help is greatly appreciated. Thanks.

 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...