theming

privatemsg_list theming refactor

  1. function privatemsg_list($uid = NULL) {
  2.   global $user;
  3.   disallow_anon_access();
  4.  
  5.   if (!$uid || $uid == $user->uid) {

Body classes for css

  1. switch ($hook) {
  2.     case 'page':
  3.      
  4.       // Check for logged in or anonymous user
  5.       $vars['logged_in'] = ($user->uid > 0) ? TRUE : FALSE;
  6.      

How to get active class back in the active trail of D5 menus

  1. In page.tpl.php, you need to change:
  2.  
  3. <div id="primary">
  4.   <?php print theme('links', $primary_links); ?>
  5. </div> <!-- /#primary -->
  6.  
  7. to:
  8.  
  9. <div id="primary">
  10.   <?php print $primary_links; ?>

changing the login fields and button text

  1. function phptemplate_user_login($form) {
  2.   $login_node = node_load(array( 'nid' => 1));
  3.   //We're removing the description text before the form is rendered
  4.   $form['pass']['#description'] = '';

Fix for Code

  1. Drupal.theme.item_list = function (items, title, type, attributes ) {
  2.   var output = '<div class="item-list">';
  3.   if (items == undefined) {
  4.     items = [];  /*initialize default values*/
  5.   }

Fix for Swap out javascript (jQuery) files

  1. We talked a little about the "best" way to swap out javascript files and the way we've been doing it recently for sites that require 1.2 and higher, you can use this method.

Individual menu classes on theme

  1. /*******individual menu classes******/
  2. function phptemplate_menu_item($mid, $children = '', $leaf = TRUE, $extraclass = '') {

block visibility code doesn't work in all regions

  1. if (drupal_is_front_page() == TRUE) {
  2.   return FALSE;
  3. } else {
  4.   return TRUE;
  5. }

Example Page template

  1. <?php
  2. //your template can be found at myspecialtemplate.tpl.php
  3. function _phptemplate_variables($hook, $vars = array()) {
  4. switch ($hook) {
  5.     case 'page':

Fix for Swap out javascript (jQuery) files

  1. /*
  2. From a Lullabot Workshop:
  3.  
Syndicate content