Improve label generation in DataContainer list
Description
While working on #4682 I wanted to add one more information to the page label (the selected feed format) and keep everything else exactly as is:

Since there can only be one label_callback, I have to overwrite the Core label listener, copy its implementation and keep it updated. I have no suggestion, but just wanted to leave a note. Maybe somebody has an idea on how to solve this in the future?
there already is the getPageIcon hook, maybe we could improve that to also generate the label?
thinking about this, if I wanted to know if a page type is RSS or JSON, I could simply add that information to the page title, right? Since the title is not seen/used anywhere in this case anyway?
there already is the getPageIcon hook, maybe we could improve that to also generate the label?
I already use this to add the icon. What do you suggest?
thinking about this, if I wanted to know if a page type is RSS or JSON, I could simply add that information to the page title, right? Since the title is not seen/used anywhere in this case anyway?
The page title is part of the feed (e.g. <title></title> in RSS), so I would like to treat the format as metadata and display it separately.
Regardless of how to improve this: this new functionality is part of the core - so you can implement it in the existing callback anyway.
The new functionality is part of the news bundle (the calendar bundle respectively), but the label callback is part of the core bundle.
What about allowing multiple label callbacks and an is_array() check to remain backwards compatible?
What about allowing multiple label callbacks and an
is_array()check to remain backwards compatible?
I don't think we can usefully apply multiple labels anywhere in the DCA, since you can never know what has been added before. It would probably work in this edge case where you just want to append something, but that might not always be the case.
This is a special case for page titles, the label should be rendered individually for each page type. We already have a hook for the icon, maybe we should just have a hook/event to generate the title for a page (including the icon)?
As discussed in the Contao call, we want to allow multiple label callbacks. We also want to make the label generation template based with the template output being passed to the label callback chain.