codefog / contao-news_categories

Extend the Contao news module with categories
MIT License
31 stars 25 forks source link

Incorrect display of news main categories. Parent will be shown, but shouldn't. #230

Open DonLars opened 1 year ago

DonLars commented 1 year ago

Hello,

I tried to create a module that only shows the elements (persons) that are assigned to the "Bauausschuss" supercategory:

Bildschirmfoto 2023-01-30 um 13 51 28

In this case, "Egon Sinnermann" will be showed into "Bauausschuss" as well, not only in "AK Märkte" or "AK Stadtentwicklung".

Bildschirmfoto 2023-01-30 um 11 51 43

Is it a bug or did I miss something? Do I need to adjust something? Have a look at this Frontend:

Bildschirmfoto 2023-01-30 um 13 19 50

I hope you help me further, LocoLars

asaage commented 1 year ago

Is it a bug or did I miss something? Do I need to adjust something?

I think by design every parent-category is inherited. You can try to play with the newslist-module settings (especialy the last one). image If you can't achieve the desired results you should probably flatten your hirarchy.

fritzmg commented 1 year ago

I think by design every parent-category is inherited.

That's what the news_includeSubcategories setting would be for. However, this setting currently only works for active filtering, but not for the default filtering. The setting is currently not considered in NewsCriteria::setDefaultCategories. I am not sure if that is by design or not.

DonLars commented 1 year ago

Thanks for your answer.

> If you can't achieve the desired results you should probably flatten your hirarchy.

Yes, but I have many different news categories that have nothing to do with each other. Bringing this to a simple hierarchy would be very confusing for editors.

_>That's what the newsincludeSubcategories setting would be for. However, this setting currently only works for active filtering, but not for the default filtering. The setting is currently not considered in NewsCriteria::setDefaultCategories.

Is there any documentation explaining how to use the different options?