/** * Override or insert variables into the node template. */ function business_responsive_theme_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function touch_preprocess_node(&$variables) { $variables['submitted'] = t('By !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date'])); if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function arup_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function metro_zymphonies_theme_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function jeugdwerksupport_preprocess_node(&$variables) { $node = $variables['node']; // Add template suggestions if (!$variables['page']) { if ($variables['teaser']) { $variables['theme_hook_suggestions'][] = 'node__' . $variables['node']->type . '__teaser'; $variables['theme_hook_suggestions'][] = 'node__' . $variables['node']->nid . '__teaser'; $variables['theme_hook_suggestions'][] = 'node__teaser'; } } // Add class 'node-full' if ($variables['view_mode'] == 'full' && node_is_page($node)) { $variables['classes_array'][] = 'node-full'; } // Set custom date format $variables['date'] = format_date($node->created, 'custom', 'F jS Y'); // Add summary variable if ($variables['view_mode'] == 'full') { $items = field_get_items('node', $node, 'body', $node->language); if ($items) { // If there's a single summary, just set the summary variable if (count($items) == 1) { $variables['summary'] = $items[0]['summary']; } else { foreach ($items as $item) { $variables['summary'][] = $item['summary']; } } } } }
/** * Override or insert variables into the node template. */ function praanaconsulting_theme_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function responsive_business_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } $variables['date'] = t('!datetime', array('!datetime' => date('j M, Y', $variables['created']))); }
/** * Override or insert variables into the node template. */ function kurr_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } $stats = statistics_get($variables['node']->nid); $variables['stats_total_count'] = $stats['totalcount']; }
/** * Override or insert variables into the node template. */ function venture_theme_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } $variables['date'] = t('!datetime', array('!datetime' => date('j F Y', $variables['created']))); }
/** * Override or insert variables into the node template. */ function flux_preprocess_node(&$variables) { $variables['date'] = format_date($variables['node']->created, 'custom', 'F j, Y'); $variables['submitted'] = t('!datetime · !username', array('!username' => $variables['name'], '!datetime' => $variables['date'])); if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
function bizutv_preprocess_node_video(&$vars, $hook) { global $user; if ($vars['view_mode'] == 'full' && node_is_page($vars['node'])) { $channels = array(); $parents = array_values(taxonomy_get_parents($vars['node']->field_channel['und'][0]['tid'])); $channel = $vars['node']->field_channel['und'][0]['taxonomy_term']; if (count($parents)) { $channels[] = array('url' => url('taxonomy/term/' . $parents[0]->tid), 'name' => $parents[0]->name, 'tid' => $parents[0]->tid); } $channels[] = array('url' => url('taxonomy/term/' . $channel->tid), 'name' => $channel->name, 'tid' => $channel->tid); $name = bizutv_helper_get_user_name($vars['node']->uid); $node_view = node_view($vars['node']); $node = $vars['node']; $theme_vars['node'] = $node; global $ibtmedia_device; if ($ibtmedia_device == 'mobile' || $ibtmedia_device == 'tablet') { $vars['node']->video_player = theme('bizutv_mobile_player', $theme_vars); } else { $vars['node']->video_player = theme('bizutv_videoplayer', $theme_vars); } $vars['node']->display_name = l($name, 'user/' . $vars['node']->uid); $vars['node']->disqus_comment = render($node_view['disqus']); $vars['node']->rate_widget = render($node_view['rate_videos']); $vars['node']->autostart = 'true'; $node_view['links']['statistics']['#links']['statistics_counter']['title'] = !empty($node_view['links']['statistics']['#links']['statistics_counter']['title']) ? str_replace('reads', 'views', $node_view['links']['statistics']['#links']['statistics_counter']['title']) : NULL; $vars['node']->reads = bizutv_video_get_node_hits($vars['node']->nid); $vars['taxonomy_parent'] = $channels; if ($vars['node']->field_stock) { foreach ($vars['node']->field_stock['und'] as $key => $stock_tag) { $vars['node']->field_stock['und'][$key]['taxonomy_term'] = taxonomy_term_load($stock_tag['tid']); } } $video_field = field_get_items('node', $node, 'field_video'); $fid = !empty($video_field[0]['fid']) ? $video_field[0]['fid'] : NULL; $duration = null; if ($fid) { $vars['duration'] = bizutv_video_time_to_iso8601_duration($fid); } $vars['thumbnail_url'] = !empty($video_field[0]['thumbnailfile']->uri) ? file_create_url($video_field[0]['thumbnailfile']->uri) : NULL; if (module_exists('bizutv_email')) { if ($user->uid) { $send_email_form = drupal_get_form('bizutv_email_form', $node); $vars['send_email_form'] = drupal_render($send_email_form); $errors = form_get_errors(); } else { $vars['send_email_form'] = '<p> <a href="/linkedin/check-session?lType=initiate" class="btn-sign-in"> Sign in or sign up</a> now! </p>'; } } } $node_user = user_load($vars['node']->uid); if (in_array('company', $node_user->roles)) { $profile = bizutv_company_get_account_profile($vars['node']->uid); $field = field_get_items('profile2', $profile, 'field_website'); $vars['company_url'] = !empty($field[0]['url']) ? $field[0]['url'] : NULL; $vars['company_title'] = !empty($field[0]['title']) ? $field[0]['title'] : NULL; } }
/** * Override or insert variables into the node template. */ function beauty_theme_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } $variables['date1'] = t('!datetime', array('!datetime' => date('\\<\\s\\p\\a\\n\\>d\\<\\/\\s\\p\\a\\n\\>\\<\\b\\r\\>M\\<\\b\\r\\>Y', $variables['created']))); $variables['date'] = t('!datetime', array('!datetime' => date('l, j F Y', $variables['created']))); }
/** * Override or insert variables into the node template. */ function multipurpose_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } //$variables['date'] = t('!datetime', array('!datetime' => date('j F Y', $variables['created']))); $variables['date'] = date('j', $variables['created']) . ' ' . t(strip_tags(date('F', $variables['created']))) . ' ' . date('Y', $variables['created']); }
/** * Override or insert variables into the node template. */ function blogbuzz_preprocess_node(&$vars) { if ($vars['view_mode'] != 'full' && $vars['id'] == 1) { $vars['classes_array'][] = 'node-first'; } if ($vars['view_mode'] == 'full' && node_is_page($vars['node'])) { $vars['classes_array'][] = 'node-full'; } }
function cni_preprocess_node(&$variables) { $node = $variables['node']; if (!empty($node->classes_array)) { $variables['classes_array'] = array_merge($variables['classes_array'], $node->classes_array); } if (node_is_page($node) !== false) { drupal_add_js('//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-56e774978692f861', 'external'); } }
/** * Implements da_vinci_preprocess_node(). */ function da_vinci_preprocess_node(&$vars) { if ($vars['view_mode'] == 'full' && node_is_page($vars['node'])) { $vars['classes_array'][] = 'node-full'; } $vars['date'] = t('!datetime', array('!datetime' => date('j F Y', $vars['created']))); // Providing templates suggestions for the nodes for view mode. $vars['theme_hook_suggestions'][] = 'node__' . $vars['view_mode']; $vars['theme_hook_suggestions'][] = 'node__' . $vars['node']->type . '__' . $vars['view_mode']; $vars['theme_hook_suggestions'][] = 'node__' . $vars['node']->nid . '__' . $vars['view_mode']; }
function thinkloud_adaptive_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } if ($variables['node']->type == 'record' && $variables['view_mode'] == 'record_big_picture') { $variables['theme_hook_suggestions'][] = 'node__record__big__picture'; $variables['classes_array'][] = 'node-teaser-big-picture'; } $variables['submitted'] = ' <a href="/user/' . $variables['uid'] . '">' . $variables['name'] . '</a>'; }
/** * Override or insert variables into the node template. */ function professional_theme_preprocess_node(&$variables) { $node = $variables['node']; if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } ///customized if ($node->type == 'course') { $variables['title'] = NULL; } ///end customized }
/** * Implements da_vinci_preprocess_node(). */ function da_vinci_preprocess_node(&$vars) { if ($vars['view_mode'] == 'full' && node_is_page($vars['node'])) { $vars['classes_array'][] = 'node-full'; } // Preprocessing title, & & " ' < y >. $vars['title'] = htmlspecialchars_decode($vars['node']->title); $vars['date'] = t('!datetime', array('!datetime' => date('j F Y', $vars['created']))); // Providing templates suggestions for the nodes for view mode. $vars['theme_hook_suggestions'][] = 'node__' . $vars['view_mode']; $vars['theme_hook_suggestions'][] = 'node__' . $vars['node']->type . '__' . $vars['view_mode']; $vars['theme_hook_suggestions'][] = 'node__' . $vars['node']->nid . '__' . $vars['view_mode']; }
/** * Override or insert variables into the node template. */ function adopted_preprocess_node(&$variables, $vars) { $node = $variables['node']; //print_r($node); if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } $variables['date'] = t('!datetime', array('!datetime' => date('j F Y', $variables['created']))); //print_r($node); $nid = $node->nid; $stats = statistics_get($nid); $vars['stats_total_count'] = $stats['totalcount']; print $vars['stats_total_count']; }
/** * @file * This file is empty by default because the base theme chain (Alpha & Omega) provides * all the basic functionality. However, in case you wish to customize the output that Drupal * generates through Alpha & Omega this file is a good place to do so. * * Alpha comes with a neat solution for keeping this file as clean as possible while the code * for your subtheme grows. Please read the README.txt in the /preprocess and /process subfolders * for more information on this topic. */ function aps_player_preprocess_html(&$variables) { drupal_add_js(drupal_get_path('theme', 'aps_player') . '/js/admin-bar.js', array('scope' => 'footer', 'weight' => '15')); // Adding in Delta class to body if (module_exists('delta')) { $deltaname = delta_get_current($GLOBALS['theme']); $deltaname = str_replace('_', '-', $deltaname); preg_match_all('!\\d+!', $deltaname, $numbers); foreach ($numbers[0] as $key => $num) { $deltaname = str_replace($num, convert_number_to_words($num), $deltaname); } $variables['attributes_array']['class'][] = 'delta-' . $deltaname ?: 'delta-none'; } // Adds the Branding class to body if ($menu_object = menu_get_object()) { if (node_is_page($menu_object) && $menu_object->type == 'menu_page') { $node_wrapper = entity_metadata_wrapper('node', $menu_object); if ($branding = $node_wrapper->field_branding->value()) { $brandingname = preg_replace('/[^\\da-z]/i', '-', drupal_strtolower($branding->title)); preg_match_all('!\\d+!', $brandingname, $numbers); foreach ($numbers[0] as $key => $num) { $brandingname = str_replace($num, convert_number_to_words($num), $brandingname); } $variables['attributes_array']['class'][] = 'branding-' . $brandingname; } } } // Adds the Delta responsive stylesheets $theme = alpha_get_theme(); if (array_key_exists('deltas-default.css', $theme->settings['css'])) { $layouts = $theme->grids['alpha_default']['layouts']; $keys = array_keys($layouts); for ($i = 0; $i < 3; $i++) { drupal_add_css(drupal_get_path('theme', 'aps_player') . '/css/deltas-default-' . $keys[$i] . '.css', array('group' => CSS_THEME, 'weight' => 120 - $i, 'media' => $layouts[$keys[$i]]['media'])); } } }
/** * Override or insert variables into the node template. */ function drupalro_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } $node = $variables['node']; // Check the image style if there is any if (isset($node->field_main_image_style[LANGUAGE_NONE][0]['value']) && isset($node->field_main_image[LANGUAGE_NONE][0]['uri']) && !empty($node->field_main_image[LANGUAGE_NONE][0]['uri'])) { // Add image class to the div wrapper $main_image_style = $node->field_main_image_style[LANGUAGE_NONE][0]['value']; if (isset($variables['content']['field_main_image'])) { $variables['content']['field_main_image']['#field_type'] .= " {$main_image_style}"; // Change image preset accordingly $variables['content']['field_main_image'][0]['#image_style'] = $main_image_style; } } if ($variables['view_mode'] == 'full' && isset($node->field_images[LANGUAGE_NONE][0]['uri'])) { $variables['content']['field_images']['#field_type'] .= ' clearfix'; } }
/** * Display a node. * * This is a hook used by node modules. It allows a module to define a * custom method of displaying its nodes, usually by displaying extra * information particular to that node type. * * @param $node * The node to be displayed, as returned by node_load(). * @param $view_mode * View mode, e.g. 'full', 'teaser', ... * @return * $node. The passed $node parameter should be modified as necessary and * returned so it can be properly presented. Nodes are prepared for display * by assembling a structured array, formatted as in the Form API, in * $node->content. As with Form API arrays, the #weight property can be * used to control the relative positions of added elements. After this * hook is invoked, node_view() calls field_attach_view() to add field * views to $node->content, and then invokes hook_node_view() and * hook_node_view_alter(), so if you want to affect the final * view of the node, you might consider implementing one of these hooks * instead. * * For a detailed usage example, see node_example.module. * * @ingroup node_api_hooks */ function hook_view($node, $view_mode) { if (node_is_page($node)) { $breadcrumb = array(); $breadcrumb[] = l(t('Home'), NULL); $breadcrumb[] = l(t('Example'), 'example'); $breadcrumb[] = l($node->field1, 'example/' . $node->field1); drupal_set_breadcrumb($breadcrumb); } $node->content['myfield'] = array('#value' => theme('mymodule_myfield', $node->myfield), '#weight' => 1); return $node; }
/** * Override or insert variables into the node template. */ function casasrealprod_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Implements template_preprocess_node(). */ function ec_resp_preprocess_node(&$variables) { $variables['prefix_display'] = FALSE; $variables['suffix_display'] = FALSE; if (isset($variables['group_content_access']) && isset($variables['group_content_access'][LANGUAGE_NONE]) && $variables['group_content_access'][LANGUAGE_NONE][0]['value'] == 2) { $variables['prefix_display'] = TRUE; } if ($variables['display_submitted']) { $variables['suffix_display'] = TRUE; } // Alter date format. $custom_date = format_date($variables['created'], 'custom', 'l, d/m/Y'); $variables['submitted'] = t('Published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $custom_date)); // Add classes. if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) { unset($variables['content']['links']['comment']['#links']['comment-add']); } switch ($variables['type']) { case 'idea': $variables['watched'] = $variables['field_watching'][0]['value']; break; case 'gallerymedia': unset($variables['content']['field_picture_upload']); unset($variables['content']['field_video_upload']); break; } // Display last update date. if ($variables['display_submitted']) { $node = $variables['node']; // Append the revision information to the submitted by text. $revision_account = user_load($node->revision_uid); $variables['revision_name'] = theme('username', array('account' => $revision_account)); $variables['revision_date'] = format_date($node->changed); $variables['submitted'] .= "<br />" . t('Last modified by !revision-name on !revision-date', array('!revision-name' => $variables['revision_name'], '!revision-date' => $variables['revision_date'])); } }
/** * Override or insert variables into the node template. */ function radicaldesigns_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function mentor_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } if ($variables['type'] == 'steps_ct') { if (isset($variables['content']['links']['node']['#links']['node-readmore'])) { $readmore = $variables['content']['links']['node']['#links']['node-readmore']; $readmore['title'] = t('Plačiau..'); // remove the old link unset($variables['content']['links']['node']['#links']['node-readmore']); // creat a new link under a different name $variables['content']['links']['node']['#links']['node-readmore-custom'] = $readmore; } } }
/** * Override or insert variables into the node template. */ function responsive_acme_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Override or insert variables into the node template. */ function forestethics_preprocess_node(&$variables) { if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } }
/** * Implements template_preprocess_node(). * * Adds extra classes to node container for advanced theming */ function theme866_preprocess_node(&$vars) { // Striping class $vars['classes_array'][] = 'node-' . $vars['zebra']; // Node is published $vars['classes_array'][] = $vars['status'] ? 'published' : 'unpublished'; // Node has comments? $vars['classes_array'][] = $vars['comment'] ? 'with-comments' : 'no-comments'; if ($vars['sticky']) { $vars['classes_array'][] = 'sticky'; // Node is sticky } if ($vars['promote']) { $vars['classes_array'][] = 'promote'; // Node is promoted to front page } if ($vars['teaser']) { $vars['classes_array'][] = 'node-teaser'; // Node is displayed as teaser. } if ($vars['uid'] && $vars['uid'] === $GLOBALS['user']->uid) { $classes[] = 'node-mine'; // Node is authored by current user. } $vars['submitted'] = t('Submitted by !username on ', array('!username' => $vars['name'])); $vars['submitted_date'] = t('!datetime', array('!datetime' => $vars['date'])); $vars['submitted_pubdate'] = format_date($vars['created'], 'custom', 'Y-m-d\\TH:i:s'); if ($vars['view_mode'] == 'full' && node_is_page($vars['node'])) { $vars['classes_array'][] = 'node-full'; } }