There are 2 main structural concepts here to understand: Containers and Items. The main purpose of a container is to provide structure and wrap items. Items are also structured, but they contain actual data (content). Both containers and items share:
- the same data structure and variables.
- special variables for injecting content at the beginning or the end of the template.
- provide wrapper markup with attributes.
- contain items.
- can wrap anything and everything from regions to form elements.
- usually contain a heading, whether visually displayed or not.
- can print all children (items) right in the container template, like
- can be overridden by component, type and id.
- are structured content made up of formats, components or both.
- do not print any wrapper markup by default.
- can optionally be wrapped with containers.
- aim to kill most of the templates and theme functions that exist in Drupal today.
- can be overridden by format, component, type, and id.
Formats consist of HTML markup defined by the spec. See examples of this in the navigation menu on the left. Some important things to note about formats:
- They need to be extremely flexible.
- If possible they should have the exact same data structure no matter what format is being used (maybe table will be an exception, but I hope not), so they can easily be switched from one format to another.
- They are variants (like theme hook suggestions) of item(s).
- They can optionally use containers.
Types are used in Drupal today to define "Drupal elements." They can be a majority of different things, like form elements, nodes, blocks, etc. When it comes to markup in a flexible system like Drupal, they are just not that special. Their relationship to the theme system today is way too tight. There are different theme functions and templates for these types and it just makes Drupal harder to work with. Drupal will always have types for processing, and this proposal does not aim to replace them, but they should not be the basis for defining our output. It just doesn't scale.