Okay. Once upon a time there was a content management system that needed to render markup. So this Content Managment System returned strings of HTML. Well that really wasn't that great because there were these people out in the world called Front End Developers and it just so happens that Front End Developers actually care about what the HTML looks like. Oh, by the way, this Content Management System is named Drupal.
Read more: https://prague2013.drupal.org/session/history-future-drupal-theming
19. What do we need? (1)
Template-based markup that
can be extended and
overridden.
hook_theme(),
template_preprocess(), hook
suggestions, theme registry, Twig
(PHPTemplate).
20. What do we need? (2)
Abstracted, alterable
structure.
Render arrays, hook_node_view(),
hook_page_alter()
21. What do we need? (3)
Sensible, accessible, API.
theme(), drupal_render(), render()
/hide()/show().
37. Decorator pattern
Behavior added to object
dynamically at runtime
without affecting other
objects of the same class.
This fulfills runtime
variable preparation.
42. Getting markup
1. Get data.
-- START RENDER PROCESS --
2. Define renderable.
3. Alter renderable.
4. Render renderable.
A. Call theme callbacks.
i. Call preprocessors.
ii. Invoke template.
-- END RENDER PROCESS --
5. Send markup to client.
50. THANK YOU!
WHAT DID YOU THINK?
Locate this session at the
DrupalCon Prague website:
http://prague2013.drupal.org/node/1863
Click the “Take the survey” link