Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. //-------------------------------------------------------------------------------------------------------------------------
  2. //Template.php
  3.  
  4.  
  5. function tb_simply_custom_preprocess_node_teaser_movie_2(&$variables) {
  6. // Recording the picture's uri
  7. $uri = $variables['field_thumbnail'][0]['uri'];
  8.  
  9. // Recording the main content node id
  10. $content_movie_nid = menu_get_object('node', 1)->nid;
  11.  
  12. // Setting new entry of $variables for the main content node id
  13. $variables['content_movie_nid'] = $content_movie_nid;
  14.  
  15. // Setting new entry of $variables for the image's html
  16. $variables['display_image'] = theme('image_style', array('style_name' => 'medium', 'path' => $uri));
  17.  
  18. // Array of image html output
  19. $image_list = array($variables['display_image']);
  20.  
  21. // Array of attributes
  22. $attributes = array(
  23. 'id' => 'my-custom-listing',
  24. 'class' => 'custom-class another-custom-class', // a string or indexed (string) array with the classes for the list tag
  25. );
  26.  
  27. // Setting new entry of $variables for the output block display html
  28. $variables['display_block_movies_list'] = theme('item_list', array('items' => $image_list,'title' => NULL,'type' => 'ul', 'attributes' => $attributes));
  29. }
  30.  
  31.  
  32.  
  33. //------------------------------------------------------------------------------------------------------------------------
  34. //node--teaser-movie-2.tpl.php
  35.  
  36. <div id="article-<?php print $node->nid; ?>" class="article <?php print $classes; ?> clearfix"<
  37. <?php print $attributes; ?>>
  38.  
  39. <?php if ($content_movie_nid != $nid): ?>
  40.  
  41. <div id="node_title_<?php print $node->nid; ?>"><a href="<?php print $node_url; ?>"><?php print $node->title; ?></a></div>
  42.  
  43. <a href="<?php print $node_url; ?>"><?php print $display_block_movies_list; ?></a>
  44.  
  45. <?php endif ?>
  46.  
  47. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement