codefog/contao-news_categories

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

Opened this issue · 3 comments

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

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.

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.

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 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.

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