Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active categories are not displayed and the number of intersection of two categories is calculated incorrectly in modular type "hierarchical" #268

Open
grashalm4u opened this issue Aug 10, 2024 · 3 comments

Comments

@grashalm4u
Copy link

grashalm4u commented Aug 10, 2024

I use the news module together with the News Categories (version 4.0.6) on my page (Contao 5.3.11) and now would like to use sub-categories.
I filter my texts primarily on topics (selection of several possible) and on years (only one year possible).
As long as I use the cumulative category filter, the number of texts in different combined categories are displayed correctly in the frontend and the active categories above the toggler are displayed correctly. Of course, no subcategories appear in this module selection.

However, if I use the cumulative hierarchical category of filters as a modular type, all subcategories are displayed. When selecting 2 categories ("Schönes" and "Lustiges"), the corresponding 5 texts are correctly selected as an intersection and correctly displayed in the news list, but the number of intersection is not calculated properly behind the second category, but still displayed the original number (61). In addition, the active categories are not output above the toggler, but remain in the list and are marked in bold.

I noticed that in the following file there is a wrong template assignment in line 30 for my terms. Or is that intended?
/vendor/codefog/contao-news_categories/src/frontendmodule/cumulativehierarchicalfiltermodule.php

@aschempp
Copy link
Collaborator

I noticed that in the following file there is a wrong template assignment in line 30 for my terms. Or is that intended?
/vendor/codefog/contao-news_categories/src/frontendmodule/cumulativehierarchicalfiltermodule.php

This is only the default template config, what you select in the back end later overrides this value.

Your setup sounds like a highly specific use case, I don't think we will be able to help here. I would suggest to debug this yourself or have a Contao developer do it for you. If you find a bug, feel free to send us a pull request for the fix 😊

@grashalm4u
Copy link
Author

I think I haven't formulated my request clearly enough. As soon as I find time, I will clarify it again.

@grashalm4u
Copy link
Author

grashalm4u commented Sep 19, 2024

I'll try to describe the main error again:
I created categories and subcategories with the news categories. When I use the "news-categories-cumulative-hierarchical" module, no active categories are displayed above my two filter togglers. However, this is the case with the "news-categories-cumulative" module. In addition, the intersection of the number of all available texts is calculated incorrectly for several selected topic categories.
If desired, I can provide access to a test installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants