Hi
I'm trying to set up a dropdown filter as well as a text search field for my Districts and Apartments which were set up in a "one-to-many" relationship, where a district can have several apartments and I haven't had any success thus far with my trials.
I also tried with a setup where I only have my apartments and the districts are setup as taxonomies ( screenshot 2 ) but still no success in achieving the results which are in the screenshot 1 attached.
Here's my link: hidden link
Screenshot attached (screenshot 1) is an example where there's a dropdown and a text search field, the way I'd like to have it setup for my Districts and Apartments.
Sincerely
How is the current setup?
If you have a post-relationship you will query the child Post (the many ends, usually) and add a Custom Search by its parent (owner)
This will produce a Front end select field to choose possible parent posts, and once submitted it would show only connected child posts, hence, you could filter apartments by the district they are assigned to.
You can not filter both in a Text Search (Apartment and District Post Type OR Taxonomy).
Text filters will only scan the post title of the queried posts and their content but nothing else to that.
So if you need to have a text search, you can only have it for the Current posts titles and post body, but not their parent (or taxonomy) districts.
The same is valid if districts are taxonomies, you can add a DropDown for those if they are assigned to apartments, but you cannot search simultaneously in the title and the taxonomy in a text field.
If you have a post-relationship you will query the child Post (the many ends, usually) and add a Custom Search by its parent (owner). This will produce a Front end select field to choose possible parent posts, and once submitted it would show only connected child posts, hence, you could filter apartments by the district they are assigned to.
As a side note I took this 'relationship' approach with the idea that would allow me to build a table view similar to what I achieved.
I think I tried that but with no result. Can I send you the login credentials for the site?
Thank You
Please use the private reply to submit them.
Please let me know precisely where I can see and if I can edit the view in question both in backend and front end.
In this case, just create a view to query apartments.
Add a Custom Filter for Departments.
Complete the loop.
I did one example for you here:
Insert that to any page you want, to see it working.
hidden link
Well the idea is that at the same time I wanted this layout here ( hidden link ) with the District title above the apartments. Isn't this possible but at the same time have the filter that you created here hidden link ?
Thank You
The layout of the results is a question of styling the Views Loop with HTML and CSS.
We cannot do this, as it's not within the support of Toolset.
But you would add HTML and CSS to the Loop editor, so to position and output your content as designed in the shared mockup.
To put the district title above the title of the apartment you can call (as I did in the loop example) the parent post data for the title, so it will display the department, I did that already in my example.
I managed to display the District above - hidden link but it shows each apartment beneath each district rather than all apartments under each district
Thank You
When you query apartments it will output each apartment title and for each apartment the parent District.
You can create a second view, as well, it'll display a list of items related to the current item in the loop.
In that case probably its better to first list departments, then in that loop insert a view that lists apartments as related to the department in the loop
But then you cannot add a search, since that is already set in the query filter (as by post in the loop)
OK
Thank You very much for your assistance 🙂
My issue is resolved now. Thank you!