--- template.php 2011-02-20 10:31:10.000000000 -0500 +++ template.php 2011-02-22 15:39:13.421149989 -0500 @@ -213,6 +213,28 @@ function zen_preprocess_html(&$variables } /** + * Override or insert variables into page template. + * + * @param $variables + * An array of variables to pass to the theme template. + * @param $hook + * The name of the template being rendered ("page" in this case.) + */ +function zen_preprocess_page(&$variables, $hook) { + // Add first and last classes to teaser lists + if (isset($variables['page']['content']['system_main']['nodes'])) { + if ($nids = element_children($variables['page']['content']['system_main']['nodes'])) { + $first_nid = reset($nids); + $last_nid = end($nids); + $first_node = $variables['page']['content']['system_main']['nodes'][$first_nid]['#node']; + $first_node->classes_array = array('first'); + $last_node = $variables['page']['content']['system_main']['nodes'][$last_nid]['#node']; + $last_node->classes_array = array('last'); + } + } +} + +/** * Override or insert variables into the maintenance page template. * * @param $variables @@ -240,6 +262,10 @@ function zen_preprocess_maintenance_page * The name of the template being rendered ("node" in this case.) */ function zen_preprocess_node(&$variables, $hook) { + $node = $variables['node']; + if (!empty($node->classes_array)) { + $variables['classes_array'] = array_merge($variables['classes_array'], $node->classes_array); + } // Add $unpublished variable. $variables['unpublished'] = (!$variables['status']) ? TRUE : FALSE;