So just a quick update here – We have figured out how to customise the search form using your add-on, and we can now search from a different office. Which is great stuff!
What we need to achieve now though, is for the form to load with preset values by default. For example, we would like one of our search forms to load ‘sales’ by default, and another with ‘lettings’ by default. We would also like to have each form be office specific (load by default office A or B).
I hope that makes sense – Is this at all possible?
Hi Daniel,
If you pass ‘?officeID=X’ (where X is the ID of the office) in the querystring I believe it will default it.
Give it a go and if it doesn’t work or if you get stuck just let me know,
Steve
Hi Steve,
This didn’t seem to work for me, unless I did it wrong. I’m not a developer, so anything beyond amending shortcodes is a little beyond my capabilities.
All we need is a sales form, and a lettings form, for each of the two office ID’s.
Is this something you can help with?
Thanks
Dan
Hi Steve,
Just a thought but is there a way to edit the ‘office’ field within template assistant, to display either of the two offices? That way I can create a form for each page and specify office, as well as sales/lettings.
Currently the office field reads <div class=”control control-office”> within the ‘before’ field, which gives me the option to choose between the two in a dropdown. Can I change this to specify just one of the office ID’s, therefor removing the ability to switch office?
Thanks
Dan
Hi Dan,
So what I think you should is in ‘Property hive > settings > template assistant > Search forms’, edit the form(s) in question and drag the ‘office’ field into the list of ‘active fields’. Then hide it using CSS. Something like so will do it:
.control-office { display:none }
Then, on the pages where want to show one offices properties do ‘?officeID=X’ in the query string, and for the other office ‘?officeID=Y’ where X and Y are the two office ID’s. You say you’ve tried it and it didn’t work, but you didn’t say what exactly you tried. Did you add the office ID’s ok? Did any properties show at all?
If unsure what the ID’s are or if you want me to just have a look in general, please send through WP access and I’ll take a look.
Steve
Have dropped you an email Steve.
Thanks
Dan