Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. function content_statistics_node_view(EntityInterface $node, EntityDisplay $display, $view_mode) {
  2. $node_count = some function called;
  3. foreach ($node_count as $key => $value) {
  4. $node_statistics = array(
  5. '#theme' => 'content_statistics_list',
  6. '#letter' => $value->letter,
  7. '#word' => $value->word,
  8. '#sentence' => $value->sentence,
  9. );
  10. }
  11. }
  12. $node->content['content_statistics_list'] = array(
  13. '#markup' => drupal_render($node_statistics)
  14. );
  15. }
  16.  
  17. /**
  18. * Implements hook_theme().
  19. */
  20. function content_statistics_theme($existing, $type, $theme, $path) {
  21. return array(
  22. 'content_statistics_list' => array(
  23. 'variables' => array('letter' => NULL, 'word' => NULL, 'sentence' => NULL),
  24. 'template' => drupal_get_path('module', 'content_statistics') . '/templates/' . 'content-statistics-list',
  25. ),
  26. );
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement