×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Category select-list on frontend
Attila Égető
New Member
Posts: 1
10 Anni 1 Settimana fa #489
da Attila Égető
Category select-list on frontend è stato creato da 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?
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?
Si prega Accedi o Crea un account a partecipare alla conversazione.
Tempo creazione pagina: 0.047 secondi