Suppose my website sells cars and other methods of transportation. I have a content type called Product and it is categorised with a taxonomy, eg. Cars, Bicyces, Boats, Helicopters.
The Product
content-type has some CCK fields to describe basic features of the product, such as horsepower
, number_of_wheels
, and top_speed
.
I use views to override the taxonomy term page, and show some exposed filters so the user can narrow their choices.
My problem is, that some of my exposed filters aren't really applicable when viewing certain terms. For example if I'm viewing the Bicycles term, I don't want to be able to filter by horsepower
! Or if I'm viewing Boats I don't want to be able to filter by number_of_wheels
(because none of my boats have wheels).
So is there a way to hide an exposed filter for a field if no rows in the view contain data in that field?
Having just one content type "Products" although simple, will ultimately cause redundancies and problems, such as what your experiencing now. It's far better to add individual content types; cars, bikes, boats and set fields unique to them. That way you can create filters easily in views against the content type.
If you were to create the table in mysql would you have just one table Products? I hope not. ;-)