This file contains 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
$(window).resize(function(){ | |
var windowHeight = jQuery(window).height(); | |
$("#header").height((windowHeight) + 'px'); | |
}); |
This file contains 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
/** | |
* Implements hook_breadcrumb | |
*/ | |
function THEMENAME_breadcrumb($variables) { | |
$breadcrumb = $variables['breadcrumb']; | |
$crumbs = '<div class="breadcrumb"><div class="wrapper"><ul>'; | |
if (!empty($breadcrumb)) { | |
// Provide a navigational heading to give context for breadcrumb links to | |
// screen-reader users. Make the heading invisible with .element-invisible. |
This file contains 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
/** | |
* Override or insert variables into the node templates. | |
* | |
* @param $vars | |
* An array of variables to pass to the theme template. | |
*/ | |
function THEMENAME_preprocess_node(&$vars) { | |
$node = $vars['node']; |
This file contains 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
/** | |
* Implements hook_form_FORM_ID_alter(). | |
*/ | |
function THEMENAME_form_alter(&$form, &$form_state, $form_id) { | |
switch ($form_id) { | |
// Remove descriptions | |
case 'user_login': | |
unset($form['name']['#description']); | |
unset($form['pass']['#description']); |
This file contains 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 print l('<span>' . t('MY TITLE') . '</span>', 'myurl', array('html' => TRUE, 'title' => t('SOME TITLE'), 'attributes' => array('class' => 'myclass'))); ?> |
This file contains 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 | |
print print_r(array_keys($fields), 1); | |
// Or if you have the developer module installed | |
dsm(array_keys($fields)); | |
?> | |
<?php if (isset($fields['field_employee_portrait']->content)): ?> | |
<div class="author-photo"> | |
<?php print $fields['field_employee_portrait']->content; ?> |
This file contains 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
/** | |
* Implements hook_form_FORM_ID_alter(). | |
*/ | |
function THEMENAME_form_alter(&$form, &$form_state, $form_id) { | |
switch ($form_id) { | |
// Search block form | |
case 'search_block_form': |
This file contains 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 | |
global $user; | |
$approved_roles = array('administrator'); | |
if (is_array($user->roles)) { | |
if (count(array_intersect($user->roles, $approved_roles)) > 0) { | |
print 'You are admin'; | |
} else { | |
print 'You are NOT admin'; | |
} | |
} |
This file contains 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) { | |
if (arg(0) == 'user' && arg(1) == 'login') { | |
drupal_set_title(t('Login')); | |
} | |
if (arg(0) == 'user') { | |
drupal_set_title(t('Login')); | |
} | |
if (arg(0) == 'user' && arg(1) == 'password') { |
OlderNewer