174 Posts
Pathos
7 years ago
2
Topic

Hello,

i have a field that i want to use as a filter on a search type but the way it is shown in the frontend is a bit cumbersome.

I have a multi-select category field. On the backend its fine it shows all the categories that a article can be associated with.


But on the frontend on the search-page it is shown also, no drop-down but all categories beneath eachother. I want it to function like a simple select box. This way people can filter and see only the articles in that category (there is no need they can select multiple). But i need multiple in the backend. Is there a simple way to show the multi-select field as a dropdown on the frontend?

Thanks,

Joris

Get a VIP membership
449 Posts
gebeer
7 years ago
0
Level 1

I wonder how you can associate one article with multiple categories. This is not possible in Joomla. Also not with SEBLOD, as you can read in this post.


To have a simple select field for categories in your search type, you need to put a simple select field in the search form. I don't think that you can make the multi select field behave like a simple select field.


You could make a custom simple select field. You put in all the categories that you want to filter into the options of the simple select field like this

category_name=ID where ID is the ID number of the category.

You can see an example here.

174 Posts
Pathos
7 years ago
0
Level 1

Well... i should have been clearer. There not joomla article categories... Its a field i created in seblod with sort of categories...

Like a product could fall under 'chemicals' and 'cleaning products'...

So in the backend it needs a multi-select box and i would like them to filter on the search-list-page on different 'categories' or typeof products. So if they are shown a list of all products available in a particular country then they would be able to filetr on chemicals and see all chemical products... etc.

I found a way to do it with jquery... But maybe there is a more correct way to do it...

I deleted some classes and attributes and added some...

If someone needs this dirty solution, let me now, i'll post it.

Greetings,

Joris

Get a VIP membership