-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add check get category #258
base: main
Are you sure you want to change the base?
Conversation
You can also give your Hook a higher priority. |
I set the other hook (https://github.com/numero2/contao-tags) a priority = 100 - without the PR I see |
Set priority for newsListFetchItems for better collaboration with news categories see also codefog/contao-news_categories#258
Yes, your own Hook will then need to process the category. Or what exactly is your goal? |
There are two different news listings - one list can be filtered by category, the other by tags. This does not work with the previous implementations. |
This needs to be fixed differently then. If category filtering is not enabled, then the hook needs to return But you will also have to make sure, that category URLs do not point to the wrong news list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, this cannot be merged as is, as there are a few problems:
- The category parameter is hardcoded, instead of being fetched from the manager.
- This would break the standard filter functionality (i.e. filtering by categories, even without an active category).
Input::get($categoryParam)
should probably not be executed here without the 3rd parameter beingtrue
.- Only
newsListFetchItems
was adjusted, instead of both hooks, leading to inconsistent behaviour.
But as already mentioned, the actual solution needs to be implemented completely differently. In essence the the hooks need to return false
if only the standard Contao behaviour applies (or should apply).
does the hook in news-categories need to return |
Yes - basically if |
I have no opinion, but feel free to give it a try 😅 |
See #263 |
With the customisation, other hooks can also customise the list.