By shrill on
Hello all.
I'm trying to theme a view using the theming wizard. I'm a bit of a newbie to php, and I can't figure out where exactly to paste the code. I get the following error:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\drupal\themes\my_theme\template.php on line 16
Here is the code for my template.php file with the views info added
<?php
function my_theme_regions() {
return array(
'sidebar_left' => t('left sidebar'),
'sidebar_right' => t('right sidebar'),
'footer' => t('footer'),
'content' => t('content'),
'header' => t('header'),
'banner' => t('banner')
);
}
/** * views template to output a view. * This code was generated by the views theming wizard * Date: Sun, 07/27/2008 - 11:21 * View: bannerview * * This function goes in your template.php file */ function phptemplate_views_view_list_bannerview($view, $nodes, $type) { $fields = _views_get_fields(); $taken = array(); // Set up the fields in nicely named chunks. foreach ($view->field as $id => $field) { $field_name = $field['field']; if (isset($taken[$field_name])) { $field_name = $field['queryname']; } $taken[$field_name] = true; $field_names[$id] = $field_name; } // Set up some variables that won't change. $base_vars = array( 'view' => $view, 'view_type' => $type, ); foreach ($nodes as $i => $node) { $vars = $base_vars; $vars['node'] = $node; $vars['count'] = $i; $vars['stripe'] = $i % 2 ? 'even' : 'odd'; foreach ($view->field as $id => $field) { $name = $field_names[$id]; $vars[$name] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view); if (isset($field['label'])) { $vars[$name . '_label'] = $field['label']; } } $items[] = _phptemplate_callback('views-list-bannerview', $vars); } if ($items) { return theme('item_list', $items); } }
?>
Thanks!
Shrill
Comments
okay figured it out
It was the TinyMCE box that was messing things up. I disabled rich text, but then it had a bunch of characters (presumably added by TinyMCE) that had been changed. So I disabled the TinyMCE module: then it worked.
Shrill