1

Looked at countless examples here but all seem to be more than I need.

I need the form to have three drop-downs

Make
-Ford
-Chevy

Color
-Red
-Blue

Transmission
-Auto
-Shift

And the search results field would look at the section called 'cars' and return any car with the exact match. One additional point is that 'Transmission' is a category.

Thanks.

1

I would probably create some categories for make, color and transmission and relate every entry to it. Then you have the ability to use craft.entries... to fetch the entries as you need them. You can find all specs of the entries method in Craft's docs - just fetch all entries that are related to the category you want.

Depending on the total number of entries you could just fetch (and cache) all entries every time and use a javascript filter mechanism. I worked with isotope before.

Using js you can achieve a smoother UX once all entries are loaded. However, best practice would be to start coding without js and make it work and then enhance the experience with js. Depends on your budget.

1

This should get you headed in the right direction: https://www.webstoemp.com/blog/combined-searches-and-filters-craft-cms/

  • Would you mind expanding on why you recommend that solution? Or at least quote some of the relevant parts of that page? "Link only" answers are frowned upon, because links can break or change over time (rendering your answer useless). – Lindsey D Jan 12 '17 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.