User login

render

Wrapping a link around a renderable array for images in Drupal 7

I was asked a question about theming linked images and gave the wrong answer, that it was a known pain point, but it kept bugging me because i was pretty sure i was not remembering something. The failure of link render arrays i was thinking of is their use in item_list, but in fact there is a secret theme function that can be used to put linked images in a render array properly.

Thanks to the amazing Morbus Iff for documenting using theme_image_formatter in a render array:

Page Rendering in Drupal 7 presentation, Moshe Weitzman, transcript

Page Rendering in Drupal 7, presentation by Moshe Weitzman at DrupalCon Paris 2009. Transcript.

Changes you can make with this rendering system that was hard with D6 but trivial in D7.

Render in Drupal 7 notes

Drupal 7 Render Arrays (and the new Render Example) by rfay
http://randyfay.com/node/79

Using the theme function: drupal 7 theme() should always take an array, a string is not officially supported. See Handing theme() function an empty string or NULL as its second parameter triggers a fatal error.

Syndicate content