Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function content_statistics_node_view(EntityInterface $node, EntityDisplay $display, $view_mode) {
- $node_count = some function called;
- foreach ($node_count as $key => $value) {
- $node_statistics = array(
- '#theme' => 'content_statistics_list',
- '#letter' => $value->letter,
- '#word' => $value->word,
- '#sentence' => $value->sentence,
- );
- }
- }
- $node->content['content_statistics_list'] = array(
- '#markup' => drupal_render($node_statistics)
- );
- }
- /**
- * Implements hook_theme().
- */
- function content_statistics_theme($existing, $type, $theme, $path) {
- return array(
- 'content_statistics_list' => array(
- 'variables' => array('letter' => NULL, 'word' => NULL, 'sentence' => NULL),
- 'template' => drupal_get_path('module', 'content_statistics') . '/templates/' . 'content-statistics-list',
- ),
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement