Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------------------------------------------------------------------------------------------------
- //Template.php
- function tb_simply_custom_preprocess_node_teaser_movie_2(&$variables) {
- // Recording the picture's uri
- $uri = $variables['field_thumbnail'][0]['uri'];
- // Recording the main content node id
- $content_movie_nid = menu_get_object('node', 1)->nid;
- // Setting new entry of $variables for the main content node id
- $variables['content_movie_nid'] = $content_movie_nid;
- // Setting new entry of $variables for the image's html
- $variables['display_image'] = theme('image_style', array('style_name' => 'medium', 'path' => $uri));
- // Array of image html output
- $image_list = array($variables['display_image']);
- // Array of attributes
- $attributes = array(
- 'id' => 'my-custom-listing',
- 'class' => 'custom-class another-custom-class', // a string or indexed (string) array with the classes for the list tag
- );
- // Setting new entry of $variables for the output block display html
- $variables['display_block_movies_list'] = theme('item_list', array('items' => $image_list,'title' => NULL,'type' => 'ul', 'attributes' => $attributes));
- }
- //------------------------------------------------------------------------------------------------------------------------
- //node--teaser-movie-2.tpl.php
- <div id="article-<?php print $node->nid; ?>" class="article <?php print $classes; ?> clearfix"<
- <?php print $attributes; ?>>
- <?php if ($content_movie_nid != $nid): ?>
- <div id="node_title_<?php print $node->nid; ?>"><a href="<?php print $node_url; ?>"><?php print $node->title; ?></a></div>
- <a href="<?php print $node_url; ?>"><?php print $display_block_movies_list; ?></a>
- <?php endif ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement