Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
a follow-up to #2031305: Remove theme_more_help_link() and replace with a #type link render array
cause I drupal_rendered them half-way through :( whoopsie
but we should also have #2042285: #theme_wrappers should be able to have a unique set of variables per wrapper hook soon.
Comments
Comment #1
thedavidmeister CreditAttribution: thedavidmeister commentedYeah, if we could take all the things that were theme_foo_link() and turn them into #type 'foo_link' that is #type 'link' + extra defaults I think that would be good. The point of having "more_link" for examples is to get some default values that help make all "more links" consistent, rather than the old way of doing things which is implementing a theme function that you can override, which makes all links *less* consistent unless you override all link templates in the same way every time.
#type is the best tool we have for providing defaults for render arrays. It does require a way to have unique #theme_wrappers variable keys though, as mentioned in the issue summary.
Comment #2
thedavidmeister CreditAttribution: thedavidmeister commentedLets look at the bigger picture and see if we need to do anything for the other link theme functions we removed in #1595614: [meta] Remove all the theme functions and templates in core that simply output a link. Replace with #type 'link' render arrays
Comment #3
thedavidmeister CreditAttribution: thedavidmeister commented#2044105: Introduce #alters for \Drupal\Core\Render\Renderer::render()
#2052253: [META] Add #render property to drupal_render() and convert #type "#pre_render -> #markup" calls to use it
Comment #4
sun