Hi,
once you have set your events table field with an option type, and filled its possible values with the mysql select from the other table, you should always see all values from the category table at the time of inserting new records. Now, for filtering using that same mysql query, the setting that will decide if the values will be only the actual ones added to the records at the events table or all the values from the category table is the
display->autofilter
switch.
Please upgrade first to latest version 5.5.4 because it contains changes about this autofilter option for some configurations, and then try to enable/disable this setting to show/hide the different option sets.
About the date filter, you need to select the filter type 'range'. For fields typed date, the filter will display a couple a calendar fields to filter dates (from-to).
Hope this helps, regards
Silvia Martín
Moonsoft Team
Thank you for your quick answers. The date field is now with the calendar, thumbs up.
But I'm still struggling with the categories. I'm afraid something is wrong with my SQL syntax. I have inserted the following SQL query: SELECT `category` FROM `vkctp_erlebniskultur_kategorie` WHERE `state` = 1 This is the syntax that works at least with phpMyAdmin. However, the corresponding filter or drop-down remains empty, it has no category selection. If I enter some values in fields/columns at “Add Values Manually” and leave the query empty, these values are displayed in the filter and I can select them. But here too there are three points that I don't understand. The categories of the events are no longer displayed in the list if I have not applied a filter. Multiple selection is not possible and only the events that contain only the selected category are selected. However, the events very often have several categories, e.g. music, show, gala. One more hint. The tables are not filled via ListManager, there is a separate component for this, as most of the data is imported externally and requires complex checks and assignments.
Best regards, Thomas
I am so sorry, that was my mistake. The SQL query is correct and works. BUT in the dropdown of the filter the background color is equal to the font color, if you select something blindly, the select is executed, but the selected category is now also equal to the background color in the input of the filter. What remains, however, is that the category of the events are not displayed in the list and in detail, with and without filter select. That's why I'm not sure at the moment whether, if an event has several categories, these are also displayed.
Regards, Thomas
Hi,
ok, please try this. Fill the values of the option with this query instead:
SELECT `category`,`category` FROM `vkctp_erlebniskultur_kategorie` WHERE `state` = 1
because the first field is used as the option value, the second one for that option text (same way you fill 2 values when added manually). With this change you should see the comboboxes with the proper texts in.
Now, if you have several categories for a single event, you will need to configure the field type as multiple option (list), with the same configuration as the standard option list, nothing to change there, but that way at the edition form a multiple select will be shown, the list will show several categories for the same record, and the filter will search if ANY of the values is the one you choose.
Last step would be to find out if the 'multiple values' you're inserting at the database follow the same pattern than the multiple option input. If you enter several values for the same record using the List Manager input form, and you choose both
cat1
and
cat2
for the category field, at the database you'll see stored at the column
cat1#cat2
in order to allow both the filters and the data view work properly. If you have any other content at the database it may need other different configuration.
Best regards
Silvia Martín
Moonsoft Team
Hi,
still no success. Only the options values are loaded and not the options text and therefore there are no options in the dropdown. If I add the categories manually in “Add Values Manually”, then it works, but not with the MySQL query.
Multi-select can probably not work, because the categories, if an event has several categories, are separated in the table with “,” and not with “#” But this is step 2 ;-)
Best regards Thomas
Hi,
ok, can you please share at the private data of this ticket a temp access so we can check that filter configuration and output? Once you have the proper options at the combobox we'll be able to move forward and look for a solution for the different separator you're using.
Thanks, best regards
Silvia Martín
Moonsoft Team
OK here they are
Hi,
ok, thanks. Our fault, the query must get a couple of values, but if recovered with the same name, the result only will contain one single column, this is the proper query
SELECT `kategorie` as id, `kategorie` as kategorie FROM `vkctp_erlebniskultur_kategorie` WHERE `state` = 1
Now for the multiple values. The proper field type would be 'multiple option', but you will find problems filtering if the values are separated with commas. Do you have intention to manage data using the List Manager form and edition, or this would be a 'read only' list and you will load data using another external method? Because in that case, there is a quick solution using a view that we can discuss.
Regards
Silvia Martín
Moonsoft Team
Hi,
you are great and thanks for your superb support. It is working now!! I load and manage most of the data with a custom component due to complex checks and mappings. I "only" use List Manager to display and filter the data.. So I am curious about the quick solution ;-)
Regards, Thomas
Hi,
great it worked!
As List Manager also works with database views, one option would be to create a view from your events table, that would contain exactly same data than the source, but replacing the commas for # at that specific column, something like
create view mynewview as(
select col1, col2,REPLACE(kategorie, ',', '#') as kategorie, colx...... from eventstable
)
And configure the List Manager to publish this view instead. That way you could continue working and introducing data at your original source table, but you will have the data properly formatted for the multiple field of ListManager at the view. This would only work for 'read ony' tables as you will surely know, DB views doesn't allow to edit data.
Please let us know if you need further help
Regards
Silvia Martín
Moonsoft Team
Hi,
that sounds easy to implement. I'll try it out this weekend and give you feedback next week. I have one more question, but will ask it in a separate ticket next week.
Have a nice weekend and thanks again for the great support.
Best regards, Thomas
Hi
sorry, but one more thing. I have not yet implemented the view. Is it possible that I cannot apply several filters at the same time? For example, if I want to select the category “Music” for February (01.02.2025 - 28.02.2025), all events in the music category are displayed without the selected date restriction..
your access to the website is still available ;-)
Hi,
in fact it should work as you expect, because all filters are combined. We found an issue when doing the combination of the multiple values and options filled with external query. Please upgrade to latest version and then check the field Kategorie, you should set at
Fields configuration->Kategorie->Avanced->Search Type =Exact
so it can match the possible values with the ones at the database.
Regards
Silvia Martín
Moosoft Team
Hi,
OK, this is my last attempt and then I'll give up.
I've now done everything as you described, but it's still not working properly. If there are several categories in an event category (e.g. Musik, Theater,...) I can only select the first category and only this category is displayed. You can test it by entering “kulturkneipe” in the title search. In the MySqL View, this event contains the categories “ Musik#Theater#Lesung”. In the frontend, however, only the category “ Musik” is displayed for this event, the other categories are not. It is also not possible to display this event in any other combination. For example, if you select “kulturkneipe” for the title and under category “Theater” ListManager finds no result. Very strange. Why can't you just use a 'LIKE “%...%”' in your query?
Best regards, Thomas
Translated with DeepL.com (free version)
Hi,
don't worry, you're almost there and everything is well configured now. We do use the like expression, but the value you're searching for is not exactly present at the column, except for the first value, the rest have a trailing space that doesn't return results when compared with your 'kategory' values recovered from the table, the value you have stored is
Musik# Theater# Lesung
if you load your view with the exact values
Musik#Theater#Lesung
then you should have the expected result. You can just remove the empty spaces using the replace function when creating your view, something like
REPLACE(kategorie, ', ', '#') as kategorie //with a blank space after the comma
or
REPLACE(REPLACE(kategorie, ',', '#'),' ','') as kategorie
or
should do the work.
Hope this helps, regards
Silvia Martín
Moosoft Team
Hi
oh no, that one little space makes all the difference. You are great. I didn't see the point. Now it's running like clockwork. I have one more question, but I'll search the forum first. If I don't find an answer, I'll get back to you with a new ticket.
Thank you very much for your patience and your brilliant support.
Best regards, Thomas
Hi,
perfect, thank you for the feedback!
We close this ticket now with this solution, we'll continue support with a new ticket if you need to.
Beest regards
Silvia Martín
Moonsoft Team
i have two tables, one table events with the fields title, date, categories (music, theater, exhibition, ...), venue and others. A second table with categories. I would now like to filter the table events with a filter categories (select). The category filter should be filled with the categories from the categories table. I can't get it to work :-( I have tried it with a MySql select statement, but only the categories from the events table are displayed for selection in the filter. How do I do it correctly or is it not possible?
The second question relates to the date filter in the events table. How do I get a calendar to be displayed and not just a text field for entering the date? The date is defined as a date field.
Mind you, both questions refer to the frontend!
Thank you for your support :-)