Here I've used a mix of great Wix design, Wix Code & Wix Databases to create a turnkey solution for property agencies.
The website has 4 pages. A home page with great search and filter functionality, a dynamic page with a custom designed gallery to display more about the individual property's features, a page linked to the databse for easily creating a new listing and adding photo's, and a similar dynamic page that automatically pulls through a selected property's details where admin staff can update and delete listings.
Thanks for all the help from the Wix experts, a special thanks to Yisrael from Wix for all the detailed explanations!
Have a look at it here:
https://tiaanrich.wixsite.com/propertyfilter
Hi Marc,
We’d have to take a look at your site and advise, but it should be. You can reach me at tiaan@wix-coders.com to discuss.
Dear Tiaan, I would like to look at using your website integrated with our existing Real estate website to list our properties in the UAE. We have all our properties listed on PropertyFinder in the UAE and would want to like this listings into your software. Do you think this is possible?
There are a lot of people that thinks they can just become investor in real estate overnight and that is how they lose their money. I have a friend who works in real estate and he is telling me stories about new investors that want to start doing it. They have no idea what to do and he is using them just because of the funds they can give. There is a platform where investors can join up together and do everything together. It is a good way to start, just be careful of not getting scammed by others. Connected investors gives you the best chance of avoiding scam.
Hi Connor,
Searches are tricky things, there can be a number of reasons why they don't work. For instance, if you run a .between search, the database fields have to be set as "number" fields as opposed to "text", and you would need values in all the fields, even if the number is "0". For the dropdowns searching this fields, you can't have any special characters like commas or spaces or currency signs..
The .contains parameter is a lot more forgiving to work with an doesn't have such stringent constraints, but it will basically just look for a text match and if nothing is found, it won't break the search function.
What I'd suggest is to start from the top, run only one filter at a time and figure out which ones return results and which don't. That be the easiest way to troubleshoot it.
Oh and before I forget, relax your database permissions completely until you get it working, you can alway make them strict again when you're ready to launch.
Good luck!
Tiaan
Tiaan !!,
whats up man. thank you for this information. it has been helpful. im sure you have much better things to do than help some dude out trying to build a similar site but i have been trying to get this search bar to work for a few days and I cant figure it out.
Code is pretty much copied from the March 5th post;
import wixData from 'wix-data';
$w.onReady(function () {
//TODO: import wixData from 'wix-data';
});
export function searchButton_click_1() {
wixData.query('getAQuote01')
.contains('area',$w('#dropdown2').value)
.contains('category',$w('#dropdown1').value)
.contains('beds',$w('#dropdown3').value)
.contains('baths',$w('#dropdown4').value)
.between("price", parseFloat($w('#dropdown5').value), parseFloat($w('#dropdown6').value))
.find()
.then( (results) =>{
$w('#repeater1').data = results.items;
});
}
I am not getting any results at all even on basic one dropdown searches.
Do my dropdowns have to be connected to my collection?
What else can I troubleshoot?
Would appreciate any advise
Hi Andrea
I’m not close to a computer at the moment, but if you scroll up a little to Steve’s post from March the 5th, that’s pretty much what the code would look like.
Best of luck!
Tiaan
Hi Tiaan,
i've just found this post and the link of your website: i've a pretty similar website, and what you did is exactly what i wanna do in my website - expecially the filtered search.
I've already read some posts here (in particular, there's an official one - with video as well - showing how to add search bar and a dropdown filter), but there are some things not explained there that i want to use: filtered search with more fields, order the list, and a button to make the filters be applied.
Can i please ask you to post the code of your page? it would really help me to replicate what you did.
Thank you in advance
Andrea
Hi cebupropertyoptions
Glad you got it fixed, best of luck with your project!
Tiaan
Hi tiaan, Thanks for the help. I found my mistakes already. My field name is different from my field key. Now I understand. Field name should be the same with field key. Now its working. Thank you very much. I learning from you.
Hi cebupropertyoptions
It seems the image sources sent to the gallery is blank if I'm reading this correct. I might need to take a look at your structure to pinpoint this problem..
Hello tiaan, thank you for your prompt response. I already change the field name. My image is numbered 1 to 10 but still only 3 images will show. I am using your code. Here's the code. from your code I only change the ("#gallery1") to ("#gallery15") since that's my gallery ID.
$w.onReady(function () {
$w('#dynamicDataset').onReady(() => {
let item = $w('#dynamicDataset').getCurrentItem();
let itemsForGallery = []; for (let i = 1; i < 12; i++) {
if (item[`image${i}`]) {
itemsForGallery.push({src: item[`image${i}`] });
} }
$w("#gallery15").items = itemsForGallery;
});
});
Another thing is that the developer console will display the following. (see screenshot)
I don't know how to address this issue. Thank you in advance.
Hi cebupropertyoptions
Something that I don’t think I mentioned is that the image field ID’s in the database should be image1, image2, image3 and so on. So if you jave a field called ‘main image’ for instance, that field will get ignored.
If you got this correct, post your code here and I’ll gladly take a look!
Hi Tiaan, I've come across to this thread and I read your post. I viewed your website and I like the way you displayed your items. The slideshows is what I am looking for in my dynamic item page. I copied & pasted your code in my dynamic page page code and it works in preview mode. I didn't change the "12" since my maximum is 10. But my problem is, it only displays 3 images out of the maximum 10 images in my database. How do I correct it. I've been spending a lot of time searching & reading in the forum and even post a message but still no one answers me. Hope you could and I really appreciate for any help. Thank you in advance.
hi, pls how you make the different maps on dynamics page? :)
Hello, i am trying to add a property page to my wix site and need to be able to add property and search too. do you have a tutorial or can help? i know its big ask but :)
Hello Steve
I’m just away from the computer at the moment, but this actually isn’t related to the code, at least not the way I use it.
In your dropdowns, replace the text it shows before a selection is made with a dropdown item of the same name (price from) and set the value to 0. Do the same for the (price to) and set the value to 1000000000. This way, it will always have values to search with, even when they are not selected.
I hope this makes sense.
Tiaan
Hey Tiaan,
I'm still having issues with my search code. It wont display results without the min and max selected. for instance if I wanted to just search for a "house" it wouldn't display results but if I select house with the min and max price it shows.
Below is my code. Not sure why it does this? Otherwise would it be possible to share your code for the full search?
import wixData from 'wix-data';
$w.onReady(function () {
//TODO: import wixData from 'wix-data';
});
export function searchButton_click() {
wixData.query('PropertiesNew')
.contains('area',$w('#dropdown4').value)
.contains('location',$w('#dropdown5').value)
.contains('propertyType',$w('#dropdown6').value)
.contains('beds',$w('#dropdown7').value)
.contains('area',$w('#dropdown4').value)
.contains('baths',$w('#dropdown8').value)
.between("fieldprice", parseFloat($w('#dropdown2').value), parseFloat($w('#dropdown3').value))
.find()
.then( (results) =>{
$w('#repeater1').data = results.items;
});
}
Hey Tiann you rock! Plugged it in and it fixed my min max problem!!!!!! Gonna try the other solution you presented. Also curious about your refresh code that one is a good idea as well. Thank you so much!
Hi Steve
The min & max were a bit more tricky, both the input field and db fields should be set to 'number'. Here is the code below:
.between("price", parseFloat($w('#selection8').value), parseFloat($w('#selection9').value)))
For the slideshows, name your db fields image1, image2, image3, etc. Then use the code below and it should work: (change the '12' to your max number + 1)
$w.onReady(function () { $w('#dynamicDataset').onReady(() => { let item = $w('#dynamicDataset').getCurrentItem(); let itemsForGallery = []; for (let i = 1; i < 12; i++) { if (item[`image${i}`]) { itemsForGallery.push({src: item[`image${i}`] }); } } $w("#gallery1").items = itemsForGallery; }); });
Best of luck with your project!
Tiaan
Hey Tiaan. Great work. Tried to do a similar thing recently. Had an issue with the min and max and also slideshows on dynamic pages. Would you be able to share your code on this? Would be amazing if possible. Thanks!