Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
simple question, hope there's a simple answer, cant find an example in the example modules and the documentation is lacking it too (at least I cant find it there)
So. How can I create a message category? or even better: What is the proper way to group/ categorize different Message Types and use Views to show all of the Messages from a specific Category?
Comments
Comment #1
geek-merlinI consider this a documentation bug.
What the source indicates: Message is not (yet) sitebuilder frindly with this, you have to add your ctegory programatically.
Something like (untested):
After creation it seems you can feature it and carry around with you ;-).
Comment #2
amitaibuAdding Message category is very rare (AFAIK only commerce is using it), so no need for a UI.
You have message_type_category_create() that can help you create it progrmatically.
Comment #4
Andre-BComment #5
Andre-Bis this example already in the documentation? if not I guess it would be great to add it.
Comment #6
amitaibuYou can add it to the online docs.
Comment #7
Andre-Bthis piece of code does not seem to be enough. If I try to add a message type to that category the textarea for inserting the message type text is missing. any thoughts?
Comment #8
Andre-Bthis might be related to #2115741: Adding a category make message field disappear
Comment #9
geek-merlinFixed and documented:
Creating message type categories and adding fields | Drupal.org