/** * Prepare variables for the drawer layout template file. */ function template_preprocess_layout__double_fixed_inner_rev(&$variables) { if ($variables['content']['sidebar'] && $variables['content']['drawer']) { $variables['classes'][] = 'layout-both-sidebars'; } elseif ($variables['content']['sidebar'] || $variables['content']['drawer']) { $variables['classes'][] = 'layout-one-sidebar'; if ($variables['content']['sidebar']) { $variables['classes'][] = 'layout-has-sidebar'; } else { $variables['classes'][] = 'layout-has-drawer'; } } else { $variables['classes'][] = 'layout-no-sidebars'; } // Special handling for header image. $variables['main_attributes'] = array('class' => array('l-content')); if (arg(0) == 'user' && is_numeric(arg(1)) && !arg(2)) { // We are on the user profile page. $variables['main_attributes']['class'][] = 'account-page'; // Check to see if there is a profile image. $account = user_load(arg(1)); // Entity cache should save us here? if (isset($account->field_header_photo[LANGUAGE_NONE][0]['uri'])) { // Generate an image at the correct size. $image = image_style_url('header', $account->field_header_photo[LANGUAGE_NONE][0]['uri']); $variables['main_attributes']['style'] = 'background-image: url(' . $image . ')'; // Add an addidional class. $variables['main_attributes']['class'][] = 'has-background'; } } }
function get_uniq_img_($row, $preset, $height) { $imagestyle = ''; !image_style_load($preset) ? $imagestyle = 'thumbnail' : ($imagestyle = $preset); $img_src = image_style_url($imagestyle, $row->field_field_blog_image[0]['rendered']['#item']['uri']); return "<img src=" . $img_src . " />"; }
function hatch_preprocess_node(&$variables) { $variables['view_mode'] = 'teaser'; $variables['common_pages'] = ''; $variables['page'] = TRUE; $node = $variables['node']; $theme_path = drupal_get_path('theme', variable_get('theme_default', NULL)); $variables['article'] = ''; if (arg(0) == 'node' && is_numeric(arg(1))) { $node = node_load(arg(1)); if ($node->type == 'article') { $variables['article'] = true; } if ($node->type == 'page') { $variables['common_pages'] = true; } $variables['nextandprev'] = nextandprev(); } if (!isset($node->field_image['und'][0]['uri'])) { $variables['image'] = base_path() . $theme_path . '/images/archive_image_placeholder.png'; } else { $img = $node->field_image['und'][0]['uri']; $teaser = $variables['teaser']; if ($teaser) { $variables['image'] = image_style_url('medium', $img); } else { $variables['image'] = image_style_url('large', $img); } } }
/** * Process callback to generate the image styles for the current file. * * @param DataInterpreterInterface $interpreter * The data interpreter for the current article entity. * @param string[] $image_styles * Array of image style names. * * @return array * A list of URLs for this images' image styles. */ public function generateStyleUris(DataInterpreterInterface $interpreter, array $image_styles) { // Call image_style_url with the retrieved $value for each $image_style. $uri = $interpreter->getWrapper()->value()->uri; return array_map(function ($image_style) use($uri) { return url(image_style_url($image_style, $uri), array('absolute' => $this->isAbsolute)); }, $image_styles); }
function odsherredsub_image_style($variables) { // Determine the dimensions of the styled image. $dimensions = array('width' => $variables['width'], 'height' => $variables['height']); image_style_transform_dimensions($variables['style_name'], $dimensions); $variables['width'] = $dimensions['width']; $variables['height'] = $dimensions['height']; $variables['attributes'] = array('class' => $variables['style_name']); // Determine the url for the styled image. $variables['path'] = image_style_url($variables['style_name'], $variables['path']); return theme('image', $variables); }
public static function image($type, $value, $name, $imageStyle = '') { if (!self::checkFieldValue($value, 'uri')) { return null; } if ($imageStyle !== '') { $processed = image_style_url($imageStyle, $value['uri']); } else { $processed = file_create_url($value['uri']); } return new ImageFieldValue($value, $processed, $type); }
function newsweek_image_style($variables) { // Determine the dimensions of the styled image. $dimensions = array('width' => $variables['width'], 'height' => $variables['height']); image_style_transform_dimensions($variables['style_name'], $dimensions); $variables['width'] = $dimensions['width']; $variables['height'] = $dimensions['height']; // Determine the URL for the styled image. $variables['path'] = image_style_url($variables['style_name'], $variables['path']); if (module_exists('ibtmedia_special_item') && ibtmedia_special_item_is_any_special_item_page()) { $variables['title'] = NULL; } return theme('image', $variables); }
function calbarber_theme_preprocess_page(&$variables) { if (arg(0) == "node" && is_numeric(arg(1))) { $nodeid = arg(1); $thenode = node_load($nodeid); //dpm($thenode); if (!empty($thenode->field_page_bgimage)) { $image_style_path = image_style_url("background_image", $thenode->field_page_bgimage['und'][0]['uri']); drupal_add_css("@media (min-width: 650px) {.main-section {background-image: url('{$image_style_path}') !important}}", array('type' => 'inline', 'group' => 'CSS_THEME', 'preprocess' => FALSE, 'media' => 'screen')); } if (!empty($thenode->field_page_hide_content) && $thenode->field_page_hide_content['und'][0]['value'] == 1) { drupal_add_css(".not-logged-in .main-content-box { \n\t\t\t\tposition: absolute; \n\t\t\t\theight: 1px;\n\t\t\t\twidth: 1px;\n\t\t\t\ttop: -990px;\n\t\t\t\tleft: -999px;\n\t\t\t\toverflow: hidden;\n\t\t\t}", array('type' => 'inline', 'group' => 'CSS_THEME', 'preprocess' => FALSE, 'media' => 'screen')); } } }
public function imageSrc($image, $style = null) { if (empty($image)) { return ''; } $uri = null; if (is_scalar($image)) { $uri = (string) $image; } else { if (is_object($image)) { $image = (array) $image; } $uri = $image['uri']; } if ($style) { return image_style_url($style, $uri); } else { return file_create_url($uri); } }
function portfolino_get_gallery() { $query = new EntityFieldQuery(); $i = (int) theme_get_setting('perpage_thumbs'); $result = $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'article')->range(0, $i)->execute(); $nids = array_keys($result['node']); $nodes = entity_load('node', $nids); $output = ""; foreach ($nodes as $node) { $output .= "<a href='node/{$node->nid}' class='item'>"; $output .= "<img src='" . image_style_url('medium', $node->field_image['und'][0]['uri']) . "' alt='{$node->title}'>"; $output .= "<h3>{$node->title}</h3><p>"; foreach ($node->field_tags['und'][0] as $tid) { $tax = taxonomy_term_load($tid); $output .= (isset($tax->name) ? $tax->name : '') . ", "; } $output .= "</p></a>"; } return $output; }
function pribehovymotiv_preprocess_comment(&$variables) { /*nutne deklarace*/ $comment = $variables['elements']['#comment']; /* * Úprava komentářových dat pro zobrazení – u needitovaných komentářů nezobrazujeme informaci o editaci * bohužel created / changed se často liší o pár sekund, takže je potřeba počítat s jistou hysterezí... * */ if ($comment->changed - $comment->created < 10) { $variables['changed'] = ''; //TODO jak moc velká prasárna je, když tu není nic? Changed se zobrazí, ale prázdný... } else { $variables['changed'] = t('Edited') . " " . format_date($comment->changed); } /*zamezime zobrazeni odkazu, ktere nechceme*/ unset($variables['content']['links']['comment']['#links']['comment-reply']); unset($variables['links']['comment']['#links']['comment_forbidden']); $variables['user_picture'] = ''; $UzivatelskaIkona = ''; $UzivatelskaIkonaURL = ''; // dpm($comment); if (!empty($comment->uid)) { $profiledata = profile2_by_uid_load($comment->uid, 'main'); if ($profiledata) { //vytahne z rozsireneho profilu uzivatelskou ikonu a zobrazi ji $UzivatelskaIkona = field_get_items('profile2', $profiledata, 'field_profil_ikonka'); if (!is_array($UzivatelskaIkona)) { //uzivatel nema ikonu, potrebujeme implicitni! $info = field_info_field('field_profil_ikonka'); $default_icon = file_load($info["settings"]["default_image"])->uri; $UzivatelskaIkonaURL = image_style_url("ikona", $default_icon); } else { //zobrazit uzivatelovu ikonu $UzivatelskaIkonaURL = image_style_url("ikona", $UzivatelskaIkona[0]['uri']); } $variables['user_picture'] = '<img src=' . $UzivatelskaIkonaURL . '>'; } } }
/** * Override for theme_image_style * Adds custom styles for this theme */ function plain_response_image_style($variables) { // Determine the dimensions of the styled image. $dimensions = array('width' => $variables['width'], 'height' => $variables['height']); image_style_transform_dimensions($variables['style_name'], $dimensions); $variables['width'] = $dimensions['width']; $variables['height'] = $dimensions['height']; $original_path = $variables['path']; $variables['attributes']['data-originalsrc'] = $original_path; // Determine the url for the styled image. $variables['path'] = image_style_url($variables['style_name'], $original_path); // Use quarter as default size. if (strpos($variables['style_name'], 'plain_response_') === 0) { $variables['path'] = image_style_url('plain_response_quarter', $original_path); if (!isset($variables['attributes']['class'])) { $variables['attributes']['class'] = ''; } $variables['attributes']['class'] .= ' ' . str_replace('plain_response_', '', $variables['style_name']); unset($variables['width']); unset($variables['height']); } return theme('image', $variables); }
<?php $output = image_style_url('slider_wide', $output); ?> <div class="slider" style="background-image: url('<?php print $output; ?> ');"> <div class="slider__container"> <div class="slider__logo"> </div> </div> </div>
$data = $row->field_field_portfolio_image; if (!count($data)) { continue; } $image = $row->field_field_portfolio_image[0]['raw']; // add captions to an empty array if (isset($image['title'])) { $captions["caption-fid-" . $image['fid']] = '<div class="header"><h3>' . l($row->node_title, 'node/' . $row->nid) . '</h3></div><div class="body">' . drupal_render($row->field_body) . '</div>' . l(t('read more'), 'node/' . $row->nid, array('attributes' => array('class' => array('button_link')))); } $file = $data[0]['rendered']; // assign iamge style $style = isset($file['#image_style']) && !empty($file['#image_style']) ? $file['#image_style'] : variable_get('glossy_style_ff_slideshow', 'front_featured_slideshow_image'); ?> <a href="<?php print url('node/' . $row->nid); ?>"><img src="<?php print image_style_url($style, $file['#item']['uri']); ?>" alt="<?php print $image['alt']; ?>" title="#caption-fid-<?php print $image['fid']; ?>"/></a> <?php endforeach;?> </div> <div id="nivo-htmlcaptions"> <?php foreach ($captions as $id => $caption): ?> <div id="<?php print $id; ?>" class="nivo-html-caption"> <div class="nivo-caption-inner"><?php print $caption; ?></div> </div> <?php endforeach;?> </div>
* - $view: The view object * - $field: The field handler object that can process the input * - $row: The raw SQL result that can be used * - $output: The processed output that will normally be used. * * When fetching output from the $row, this construct should be used: * $data = $row->{$field->field_alias} * * The above will guarantee that you'll always get the correct data, * regardless of any changes in the aliasing that might happen if * the view is modified. */ // Print only portfolio item $data = $row->field_field_portfolio_image; if (!count($data)) { return; } $file = $data[0]['rendered']; // assign image style $style = isset($file['#image_style']) && !empty($file['#image_style']) ? $file['#image_style'] : variable_get('glossy_style_ff_slideshow', 'front_featured_slideshow_image'); ?> <Image Source="<?php print image_style_url($style, $file['#item']['uri']); ?>" Title="<?php print $file['#item']['title']; ?>"> <Text><h1><?php print $row->node_title; ?></h1><?php print array_shift($row->field_body[0]['rendered']); ?></Text> <Hyperlink URL="<?php print url('node/' . $row->nid); ?>" Target="_self"/> </Image>
* configured element type. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */ $link = FALSE; $anchor = strip_tags($fields['view_submission']->content, '<a>'); if (!empty($anchor)) { $a = new SimpleXMLElement($anchor); $link = $a['href']; } $price = strip_tags($fields['value_5']->content); $termObj = taxonomy_term_load(strip_tags($fields['value']->content)); $termObjLocalized = i18n_taxonomy_localize_terms($termObj); $icon_uri = isset($termObj->field_map_icon['und'][0]['uri']) ? $termObj->field_map_icon['und'][0]['uri'] : 'public://default_images/unnamed.png'; $backgroundUrl = image_style_url('medium', $icon_uri); $nameAddUrl = url('ak_mermix_tools/nojs/addphone/' . $price, array('query' => array('sid' => $fields['sid']->raw))); if ($link) { $fields['value']->content = '<div class="category" style="background: url(\'' . $backgroundUrl . '\') no-repeat"><a class="title" href="' . $link . '">' . $termObjLocalized->name . '</a></div>'; } else { $fields['value']->content = '<div class="category" style="background: url(\'' . $backgroundUrl . '\') no-repeat"><span class="title">' . $termObjLocalized->name . '</span></div>'; } $fields['value']->wrapper_prefix = ''; $fields['value']->wrapper_suffix = ''; $fields['value_1']->wrapper_suffix = $fields['value_1']->wrapper_suffix . '<a class="add-it btn btn-primary large-btn ctools-use-modal" href="' . $nameAddUrl . '"><span class="name">' . t('More information') . '</span></a>'; $fields['value_1']->content = $fields['value_1']->content . $fields['value_4']->content; unset($fields['value_4']); unset($fields['value_5']); unset($fields['sid']); unset($fields['view_submission']); foreach ($fields as $id => $field) {
/** * Display Inherit Image gallery */ function foundation_access_preprocess_node__inherit__image_gallery__image(&$variables) { $variables['images'] = array(); $variables['image_caption'] = ''; $variables['image_cite'] = ''; $variables['image_lightbox_urls'] = ''; // Assign Image if (isset($variables['elements']['field_images'])) { $tmpimages = $variables['elements']['field_images']['#items']; // append classes to images for rendering foreach ($tmpimages as $key => $image) { $variables['images'][$key] = array('#theme' => 'image_formatter', '#item' => $tmpimages[$key]['entity']->field_image[LANGUAGE_NONE][0], '#image_style' => 'image_gallery_square', '#path' => ''); // alt/title info if (empty($variables['images'][$key]['#item']['alt'])) { $variables['images'][$key]['#item']['alt'] = $image['entity']->title; } if (empty($variables['images'][$key]['#item']['title'])) { $variables['images'][$key]['#item']['title'] = $image['entity']->title; } $variables['images'][$key]['#item']['attributes']['class'][] = 'image__img'; $variables['images'][$key]['#item']['attributes']['class'][] = 'responsive-img'; // special class applied to the image itself to make it a circle if (strpos($variables['view_mode'], 'circle')) { $variables['images'][$key]['#item']['attributes']['class'][] = 'circle'; } // If the viewmode contains "lightbox" then enable the lightbox option if (strpos($variables['view_mode'], 'lightboxed')) { $variables['image_lightbox_url'][$key] = image_style_url('image_lightboxed', $tmpimages[$key]['entity']->field_image[LANGUAGE_NONE][0]['uri']); } } } $tmp = explode('__', $variables['view_mode']); // inherrit class structure from deep structures if (count($tmp) > 1) { // build the base from the 1st two items $base = array_shift($tmp); // loop through what's left to add as classes foreach ($tmp as $part) { $class = $base . '--' . $part; $variables['classes_array'][] = $class; } } // Assign Caption if (isset($variables['elements']['field_image_caption'][0]['#markup'])) { $variables['image_caption'] = $variables['elements']['field_image_caption'][0]['#markup']; } // Assign Cite if (isset($variables['elements']['field_citation'][0]['#markup'])) { $variables['image_cite'] = $variables['elements']['field_citation'][0]['#markup']; } // account for card size if (strpos($variables['view_mode'], 'card')) { if (strpos($variables['view_mode'], 'small')) { $variables['card_size'] = 'small'; } elseif (strpos($variables['view_mode'], 'large')) { $variables['card_size'] = 'large'; } else { $variables['card_size'] = 'medium'; } } }
* - $field->inline: Whether or not the field should be inline. * - $field->inline_html: either div or span based on the above flag. * - $field->wrapper_prefix: A complete wrapper containing the inline_html to use. * - $field->wrapper_suffix: The closing tag for the wrapper. * - $field->separator: an optional separator that may appear before a field. * - $field->label: The wrap label text to use. * - $field->label_html: The full HTML of the label to use including * configured element type. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */ ?> <div class="col-inner"<?php $uri = isset($row->field_field_wallpaper[0]) ? $row->field_field_wallpaper[0]['raw']['uri'] : ''; echo !empty($uri) ? ' style="background-image: url(' . image_style_url('important_topics_wallpaper', $uri) . ')"' : ''; ?> > <?php foreach ($fields as $id => $field) { ?> <?php if (!empty($field->separator)) { ?> <?php print $field->separator; ?> <?php } ?>
?> <?php if (in_array('מנהל', $user->roles)) { ?> <div class="edit"><?php print l('Edit', 'node/' . $row->nid . '/edit'); ?> </div> <?php } ?> <?php switch ($layout_value) { case '2': print '<img src="' . image_style_url($style_188_120, $portfolio_image) . '">'; break; case '3': print '<img src="' . image_style_url($style_584_250, $portfolio_image) . '">'; break; case '6': print '<img src="' . image_style_url($style_188_250, $portfolio_image) . '">'; break; case '7': print '<img src="' . image_style_url($style_385_250, $portfolio_image) . '">'; break; } ?> </div>
* var_export to dump this object, as it can't handle the recursion. * - $field->inline: Whether or not the field should be inline. * - $field->inline_html: either div or span based on the above flag. * - $field->wrapper_prefix: A complete wrapper containing the inline_html to use. * - $field->wrapper_suffix: The closing tag for the wrapper. * - $field->separator: an optional separator that may appear before a field. * - $field->label: The wrap label text to use. * - $field->label_html: The full HTML of the label to use including * configured element type. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */ $style = $row->field_field_map_icon[0]['rendered']['#image_style']; $backgroundUri = $row->field_field_map_icon[0]['raw']['uri']; $backgroundUrl = image_style_url($style, $backgroundUri); ?> <div class="fields-wrapper <?php print $style; ?> " style="background-image: url('<?php print $backgroundUrl; ?> ')"> <?php foreach ($fields as $id => $field) { ?> <?php if (!empty($field->separator)) { ?> <?php
<?php } else { ?> <div class="image-preview"> <a class="image-popup overlayed" href="<?php print file_create_url($node->field_image[$lang][0]['uri']); ?> " title="<?php print $node->field_image[$lang][0]['title']; ?> "> <img src="<?php print image_style_url('large', $node->field_image[$lang][0]['uri']); ?> " alt="<?php print $node->field_image[$lang][0]['alt']; ?> " title="<?php print $node->field_image[$lang][0]['title']; ?> "/> <span class="overlay large"><i class="fa fa-plus"></i></span> </a> <?php if ($node->field_image[$lang][0]['title'] || $node->field_image[$lang][0]['alt']) { ?> <div class="image-caption hidden-xs">
?> " data-rel="prettyPhoto[g_gal]"> <img src="<?php print image_style_url('thumbnail', $active['#item']['uri']); ?> " alt=""/> </a> </li> <?php foreach ($items as $item) { ?> <li> <a href="<?php print file_create_url($item['#item']['uri']); ?> " data-rel="prettyPhoto[g_gal]"> <img src="<?php print image_style_url('thumbnail', $item['#item']['uri']); ?> " alt=""/> </a> </li> <?php } ?> </ul> </div> </div> </div>
foreach ($node->field_image[$lang] as $key => $file) { if ($key == 0) { continue; } $i++; ?> <div class="image-listing-item overlayed small plus"> <a class="image-popup" href="<?php print file_create_url($node->field_image[$lang][$key]['uri']); ?> " title="<?php print $node->field_image[$lang][$key]['title']; ?> "> <img src="<?php print image_style_url('small', $node->field_image[$lang][$key]['uri']); ?> " alt="<?php print $node->field_image[$lang][$key]['alt']; ?> " title="<?php print $node->field_image[$lang][$key]['title']; ?> "/> </a> </div> <?php } ?> </div>
<?php print render($content['body']); $cstyle = $content['field_champ_img']['0']['#image_style']; $champ = "<img src='" . image_style_url($cstyle, $content['field_champ_img']['#items']['0']['uri']) . "'>"; $sstyle = $content['field_champ_img']['0']['#image_style']; $sport = "<img src='" . image_style_url($sstyle, $content['field_sports_img']['#items']['0']['uri']) . "'>"; $hstyle = $content['field_champ_img']['0']['#image_style']; $hof = "<img src='" . image_style_url($hstyle, $content['field_hof_img']['#items']['0']['uri']) . "'>"; ?> <ul class="rs awards border"> <li class="left"><a href="/intramurals/wall-of-champions">Wall of Champions</a><?php print $champ; ?> </li> <li class="right"><a href="/intramurals/sportsmanship">Sportsmanship Awards</a><?php print $sport; ?> </li> <li class="left"><a href="/intramurals/officials/hall-of-fame">Officials Hall of Fame</a><?php print $hof; ?> </li> </ul>
* @ingroup themeable */ $user = $elements['#account']; ?> <div class="profile col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xs-offset-0 col-sm-offset-0 col-md-offset-3 col-lg-offset-3"<?php print $attributes; ?> > <div class="well"> <center> <?php if ($user->picture) { ?> <?php $default_thumbnail = image_style_url('medium', $user->picture->uri); ?> <img class="img-circle" src="<?php print $default_thumbnail; ?> "/> <?php } ?> <h3><?php print render($user_profile['field_civilite'][0]); ?> <?php print render($user_profile['field_nom_et_prenom'][0]); ?>
<div class="blog-article"> <div class="blog-title" style="background-image: url(<?php print render(image_style_url('thumbnail', $content['field_blog_article_image']['#items'][0]['uri'])); ?> );background-repeat: no-repeat;background-size: cover;background-position: center;"> <h2><?php print $title; ?> </h2> </div> <div class="container"> <h3><?php print render($content['field_blog_article_type']); ?> </h3> <h4>By: <?php print render($content['field_author']); ?> </h4> <div class="blog-content"> <?php print render($content['body']); ?> </div> </div> </div>
<div class="hero-content iac-container"> <div class="hero-content__text"> <?php print $node->field_front_hero_text['und'][0]['value']; ?> </div> <?php global $user; if (in_array("administrator", $user->roles) || $user->uid == 1) { print '<div class="iac iac-edit pretty medium primary btn icon-left icon-pencil"><a href="' . url('node/' . $node->nid . '/edit') . '">Edit</a></div>'; } ?> </div> <?php if (isset($node->field_front_cover)) { $background_image = image_style_url("hero", $node->field_front_cover['und'][0]['uri']); drupal_add_css("#hero {background-image: url('" . $background_image . "') ;}", array('type' => 'inline')); }
$image_uri = 'media-cloudcast/' . $node->field_show_vod['und'][0]['filename'] . '.jpg'; break; // Vimeo // Vimeo case 'video/vimeo': $image_uri = str_replace('vimeo://v/', 'media-vimeo/', $node->field_show_vod['und'][0]['uri']); $image_uri = $image_uri . '.jpg'; break; // Youtube // Youtube case 'video/youtube': $image_uri = str_replace('youtube://v/', 'media-youtube/', $node->field_show_vod['und'][0]['uri']); $image_uri = $image_uri . '.jpg'; break; } $img_src = image_style_url('250x150', $image_uri); } else { $img_src = ''; } // Description if (isset($node->field_description['und'][0]['value'])) { $show_description = $node->field_description['und'][0]['value']; } else { $show_description = ''; } // Series title if (isset($node->og_group_ref['und'][0]['target_id'])) { $nid = $node->og_group_ref['und'][0]['target_id']; $series_title = db_query("SELECT title FROM {node} WHERE nid = :nid", array(':nid' => $nid))->fetchField(); } else { $series_title = '';
/** * Display Inherit Image */ function foundation_access_preprocess_node__inherit__elmsmedia_image__image(&$variables) { $variables['image'] = array(); $variables['image_caption'] = ''; $variables['image_cite'] = ''; $variables['image_lightbox_url'] = ''; // Assign Image if (isset($variables['elements']['field_image'][0])) { $variables['image'] = $variables['elements']['field_image'][0]; $variables['image']['#item']['attributes']['class'][] = 'image__img'; } // Assign Caption if (isset($variables['elements']['field_image_caption'][0]['#markup'])) { $variables['image_caption'] = $variables['elements']['field_image_caption'][0]['#markup']; } // Assign Cite if (isset($variables['elements']['field_citation'][0]['#markup'])) { $variables['image_cite'] = $variables['elements']['field_citation'][0]['#markup']; } // If the viewmode contains "lightbox" then enable the lightbox option if (strpos($variables['view_mode'], 'lightboxed')) { $variables['image_lightbox_url'] = image_style_url('image_lightboxed', $variables['image']['#item']['uri']); } }
$title = $view['0']->_field_data['nid']['entity']->title; $body = $view['0']->_field_data['nid']['entity']->body['und']['0']['value']; $body_str = ""; $body = explode(' ', $body); $counter = 0; foreach ($body as $row) { $body_str = $body_str . ' ' . $row; if ($counter == 50) { break; } $counter++; } $body = $body_str . '...'; $address = $view['0']->_field_data['nid']['entity']->field_address['und']['0']['value']; $image = $view['0']->_field_data['nid']['entity']->field_image['und']['0']['uri']; $url = image_style_url('large', $image); $link = drupal_lookup_path('alias', "node/" . $view['0']->nid); ?> <div class="<?php print $classes; ?> "> <div class="views-row views-row-1 views-row-odd views-row-first views-row-last"> <div class="views-field views-field-field-image"> <div class="field-content featured-brewery-image"> <a href="/preview/<?php echo $link; ?> "> <img typeof="foaf:Image" src="<?php print $url;