This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ($picture): ?> | |
<?php | |
$user = user_load($user->uid); | |
print theme_image_style ( | |
array ( | |
'style_name' => 'user-photo', | |
'path' => $user->picture->uri, | |
'attributes' => array ('class' => 'user-photo'), | |
'width' => NULL, | |
'height' => NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path = $vars['field_company'][0]['entity']->field_company_logo_medium['und'][0]['uri']; | |
$alt = $vars['field_company'][0]['entity']->title; | |
$title = t('View case study'); | |
$logo = '<img src="' . file_create_url($path) . '" title="' . $title . '" alt="' . $alt . '"/>'; | |
// Logo | |
$vars['content']['logo'] = array( | |
'#markup' => l($logo, 'node/' . $node->nid, array('html' => TRUE)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file | |
* A JavaScript file for the theme. | |
* | |
* In order for this JavaScript to be loaded on pages, see the instructions in | |
* the README.txt next to this file. | |
*/ | |
// JavaScript should be made compatible with libraries other than jQuery by | |
// wrapping it with an "anonymous closure". See: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$block = module_invoke('views', 'block' , 'view', 'fanvision_news-block_1'); | |
print $block['content']; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load specific Javscript on specific pages based on node id. | |
* | |
* @param $vars | |
* @param $hook | |
*/ | |
function THEMENAME_preprocess(&$vars, $hook) { | |
$node = menu_get_object('node'); | |
// Disable race |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function print_r_html ($arr) { | |
?><pre><? | |
print_r($arr); | |
?></pre><? | |
} | |
function THEMENAME_form_alter(&$form, &$form_state, $form_id) { | |
print_r_html($form); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function THEMENAME_preprocess_page(&$vars) { | |
// Change site name based on language | |
global $language; | |
$userlanguage = $language->language; | |
switch ($userlanguage) { | |
case 'en': | |
case 'uk': | |
case 'ie': | |
$vars['site_name'] = t('Partner Marketing Materials'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function THEMENAME_preprocess_page(&$vars) { | |
// Add "addcourse.css" to Add Course page only | |
if(strstr($_SERVER['REQUEST_URI'], "admin/commerce/products/$path_alias")) { | |
drupal_add_css( | |
path_to_theme() . '/css/addcourse.css', | |
array( | |
'group' => CSS_THEME, | |
) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set up some variables | |
$photo = $node->field_profile_photo['und']['0']['view']; | |
$recommend = $node->field_profile_recommend['und']['0']['value']; | |
$body = $node->content['und']['body']['#value']; | |
?> | |
<?php if ($photo): ?> | |
<div class="profile-photo profile-field"> | |
<h3><?php print t('Photo'); ?>:</h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert "px" to "em" | |
@function em($target, $context: $base-font-size) { | |
@if $target == 0 { @return 0 } | |
@return $target / $context + 0em; | |
} |