Download & Extend

Use theme functions when markup is returned

Project:Paging
Version:6.x-1.0-beta3
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Please remove

  return '<div class="links">' . $output . '</div>';

from the code below and replace it with
return $output;

We can move the div into the theming layer were it belongs. My issue is that I am already using a links name for something else in the node.tpl.php. I would expect to be able to override this, but I can not because this is not a themeing function.
Thanks!

function paging_pager_style($node = NULL, $element = NULL) {
  $theme_widget = variable_get('paging_pager_widget_' . $node->type, 'pager');

  if ($theme_widget == 'custom') {
    // Load the custom user function.
    $theme_widget = variable_get('paging_pager_widget_custom_' . $node->type, 'pager');
  }

  if ($theme_widget == 'paging_drop_down') {
    // Include CSS for 'Drop down pager' styling.
    drupal_add_css(drupal_get_path('module', 'paging') . '/paging.css', 'module');
  }

  // Decode the comma entity.  
  $output = str_replace('%2C', ',', theme($theme_widget, NULL, 1, $element, array(), 9, $node->page_names));

  return '<div class="links">' . $output . '</div>';
}

Comments

#1

Title:Remove theme information from not theme function» Use theme functions when markup is returned
Category:bug report» task
Status:active» needs review

Same request here. I need to change the class on this div (since "links" means something else in Drupal) but can't since it's not in a theme function. Attached patch adds a theme function.

#2

It helps if I actually attach the patch :/

AttachmentSize
theme.patch 1.38 KB