User login

page rendering

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:

Adding non-menu things to primary links menu items with Drupal 7's page alter hook

The request was to stick search in a menu. I said "I bet that's easy with hook_page_alter()!"

Not quite.

The primary links menu is output directly by the theme, and so is one of the very very few things that occurs after hook_page_alter().

You can tell the theme to stop outputting it directly, and put it in a block that is displayed in a region, or you can add it to the page rendering array in code with hook_page_build().

Measure CSS rendering time

The Net in Firebug can do this.

Enable it, reload the page, and click on the CSS subtab.

There are two values you can look as the render completion times, the thin red and thin blue lines, compared to the end of the loading of actual files. DOMContentLoaded is the vertical blue line and load is represented by the vertical red line.

You can see the exact values by hovering over any request. (See screenshot.)

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.

Syndicate content