Skip Navigation

[Resolved] Setting up search dropdown and text search for my list view

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Author
Posts
#1233092
screenshot2.png
screenshot 1.png

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

#1233199

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.

#1233208

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

#1233209

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.

#1233250

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

#1233252

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

#1233257

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.

#1233263

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

#1233264

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)

#1233279

OK

Thank You very much for your assistance 🙂

#1233280

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.