× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Category select-list on frontend

10 years 4 days ago #489 by Attila Égető
Category select-list on frontend was created by Attila Égető
Hi!

I'm relatively new in Joomla development, but this stuff makes life much easier.
Now, I'm developing a downloader component in J!25. The administrators can upload apps, documents, etc on the backend, and users can download it on frontend. The admins can create categories, which helps the users to decide what kind of thing sits on the other side of the "Download" link. I've used J_Category field type for this, and checked to show it on the list view, and also checked the Include field in text based searches and Add a filter for this field on the list view options.

I had some problem with the text based search, because it found nothing searching to the category names. This is because the query string searches in the custom component's table, but, because with J_Category, it is a foreign key, it stores only the id from the native Joomla #__categories table. So, if i've searched to pdf, it returned nothing, but a search to 13 (which is the id of the pdf category in the #__categories table) returned the items in the category. OK, it wasn't hard to modify the query string from a.category to category.title, but if somebody not familier with SQL, it would be hard, so maybe it would be useful to automatically generate the query string in this way. It's only a tip, maybe there's a reason  not to do so.

My second problem is with the Add a filter for this field on the list view option. I've checked it, and got a nice select-list on the back-end, but nothing on front-end. It would be useful, if users can select from the list only the category they want to search in, but I've didn't found a solution for this. I've tried to copy and modify the code from the backend version, but it didn't worked. Maybe someone has a solution?

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.