1 theming_example.module theme_theming_example_list($variables)

Theming a simple list.

This is just a simple wrapper around theme('item_list') but it's worth showing how a custom theme function can be implemented.

See also

theme_item_list()

Related topics

File

modules/examples/theming_example/theming_example.module, line 296
Hook implementations for the Theming Example module.

Code

function theme_theming_example_list($variables) {
  $title = $variables['title'];
  $items = $variables['items'];

  // Add the title to the list theme and
  // state the list type. This defaults to 'ul'.
  // Add a css class so that you can modify the list styling.
  // We'll just call theme('item_list') to render.
  $variables = array(
    'items' => $items,
    'title' => $title,
    'type' => 'ol',
    'attributes' => array('class' => 'theming-example-list'),
  );
  $output = theme('item_list', $variables);
  return $output;
}