The Homeflow API allows you to add and query all manner of agency staff information and output it to your site wherever you choose.
Add/query basic information
Your first port of call before we can query any of the staff information is to add some. The Homeflow platform has hundreds if not thousands of profiles already loaded, so you might find we already have staff on record. That aside, log on to your agency admin and navigate to: /configure/business/staff. From here follow the links to add/modify/remove staff as required.
note: Staff members will not appear in the live data until they have both and avatar and either sales/lettings enabled.
Let’s start with the staff index - the entry point that lists all staff members. This index.liquid file should live within a staff folder in your repository. A simple loop to retrieve all staff could be:
The next page you will want to create is the staff show page - show.liquid. This page does not require any kind of loop and instead you can simply use the staff_member drop to access the information you require. Here’s a typical construct you might come across:
Checkout the staff drop section for more available methods.
Staff by channel
Say you want to extract some or all sales staff on sales properties and the same for lettings. Here’s how you can do just that:
Then to test and output our newly created staff array:
The selected_by code seen above can be used to filter an array based on an attribute of an object. contactable_for_sales is a true or false attribute we can use to filter staff, depending on the property’s channel.