Drupal tip: Stripping out nested divs in views blocks


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function phptemplate_views_view_list($view, $nodes, $type) {
  2. $fields = _views_get_fields();
  3. foreach ($nodes as $node) {
  4. $item = '';
  5. foreach ($view->field as $field) {
  6. if ($field['label']) {
  7. $item .= '<div class="view-label view-label-$field[queryname]">'. $field['label'] ."</div>";
  8. }
  9. $item .= views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view) . "<br />";
  10. }
  11. $items[] = "$item"; // l($node->title, "node/$node->nid");
  12. }
  13. if ($items) {
  14. return theme('item_list', $items);
  15. }
  16. }

URL: http://urlgreyhot.com/personal/weblog/drupal_tip_stripping_out_nested_divs_in_views_blocks

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.