This project is not covered by Drupal’s security advisory policy.
A simple way to lay out fields on content. Field layout is a light-weight, developer-friendly approach to theming which uses php arrays to define layouts, generating the necessary markup for complex node layouts automatically. If you are looking for an admin friendly solution with many more options and a user interface try Display Suite or Panels.
Field layout defines 9 default regions (top, float-left, float-right, body, bottom, etc.) into which node fields can be placed. To rearrange your fields, you simply implement a hook in your theme that returns an array specifying which region to put each field into. You override the layout for detail display, teasers, per-content type, per-view and per node-reference. Layouts can also be changed dynamically in your theme's node_preprocess hook to allow layouts to react to the node contents. Page level regions are also supported so you can place node fields outside of the main content region or in additionally defined blocks with minimal effort. You can also override the default field display formatter per context.
All rendering is done by drupal_render which brings some of the power of the Drupal 7 rendering model to Drupal 6, and provides a performance improvement over using CCKs 'exclude field' settings.
An example of a layout configuration is:
function MYTHEME_fieldlayout_node_fields() {
return array(
'default' => array(
'teaser' => array(
'title' => array('#region' => 'top',
'#weight' => -10,
'#wrap' => 'h3',
'#attributes' => array('class' => 'node-title')),
'submitted' => array('#region' => 'top'),
'content' => array('#region' => 'body'),
'links' => array('#region' => 'bottom'),
'content_body' => array('#region' => 'hidden'),
'field_image' => array('#region' => 'hard_left',
'#formatter' => 'thumbnail_linked'),
),
'full' => array(
'submitted' => array('#region' => 'top'),
'content' => array('#region' => 'body'),
'terms' => array('#region' => 'bottom'),
'links' => array('#region' => 'bottom'),
'field_image' => array('#region' => 'hard_left',
'#formatter' => 'detail_default'),
),
),
);
}
Alternative and Similar Modules
- Display Suite
- Provides similar layout abilities. Works with nodes and many other types and features a full user interface. Display suite is more mature and feature-rich than this module and should be used instead of this module unless you want a simpler more stripped down solution.
- Panels
- Allows you to create multi-panel layouts. Panels is not primarily focused on laying out the fields of particular node types but can be used to do so.
- CCK Blocks
- Allows you to add CCK fields to the page regions as blocks.
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.- Project categories: Content display, Developer tools
5 sites report using this module
- Created by ronan on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

