Example #1
0
 */
include_once './' . drupal_get_path('theme', 'zen') . '/template.php';
/*
 * Add the stylesheets you will need for this sub-theme.
 *
 * To add stylesheets that are in the main Zen folder, use path_to_theme().
 * To add stylesheets that are in your sub-theme's folder, use path_to_subtheme().
 */
// Add any stylesheets you would like from the main Zen theme.
drupal_add_css(path_to_theme() . '/html-elements.css', 'theme', 'all');
drupal_add_css(path_to_theme() . '/tabs.css', 'theme', 'all');
// Then add styles for this sub-theme.
drupal_add_css(path_to_subtheme() . '/layout.css', 'theme', 'all');
drupal_add_css(path_to_subtheme() . '/nabuur_blog.css', 'theme', 'all');
// Avoid IE5 bug that always loads @import print stylesheets
zen_add_print_css(path_to_subtheme() . '/print.css');
/**
 * Declare the available regions implemented by this theme.
 *
 * @return
 *   An array of regions.
 */
/* -- Delete this line if you want to use this function
function nabuur_blog_regions() {
  return array(
    'left' => t('left sidebar'),
    'right' => t('right sidebar'),
    'navbar' => t('navigation bar'),
    'content_top' => t('content top'),
    'content_bottom' => t('content bottom'),
    'header' => t('header'),
Example #2
0
/**
 * Override or insert PHPTemplate variables into the page templates.
 *
 * @param $vars
 *   A sequential array of variables to pass to the theme template.
 */
function zen_preprocess_page(&$vars)
{
    global $theme, $theme_key;
    // Allow sub-themes to have an ie.css or wireframes.css file.
    $vars['subtheme_directory'] = path_to_subtheme();
    // These next lines add additional CSS files and redefine
    // the $css and $styles variables available to your page template
    if ($theme == $theme_key) {
        // If we're in the main theme
        // Load the stylesheet for a liquid layout
        if (theme_get_setting('zen_layout') == 'border-politics-liquid') {
            drupal_add_css($vars['directory'] . '/layout-liquid.css', 'theme', 'all');
        } else {
            drupal_add_css($vars['directory'] . '/layout-fixed.css', 'theme', 'all');
        }
        drupal_add_css($vars['directory'] . '/html-elements.css', 'theme', 'all');
        drupal_add_css($vars['directory'] . '/tabs.css', 'theme', 'all');
        drupal_add_css($vars['directory'] . '/zen.css', 'theme', 'all');
        // Avoid IE5 bug that always loads @import print stylesheets
        $vars['head'] = zen_add_print_css($vars['directory'] . '/print.css');
    }
    // Optionally add the block editing styles.
    if (theme_get_setting('zen_block_editing')) {
        drupal_add_css($vars['directory'] . '/block-editing.css', 'theme', 'all');
    }
    // Optionally add the wireframes style.
    if (theme_get_setting('zen_wireframes')) {
        if ($vars['subtheme_directory'] && file_exists($vars['subtheme_directory'] . '/wireframes.css')) {
            drupal_add_css($vars['subtheme_directory'] . '/wireframes.css', 'theme', 'all');
        } else {
            drupal_add_css($vars['directory'] . '/wireframes.css', 'theme', 'all');
        }
    }
    $vars['css'] = drupal_add_css();
    $vars['styles'] = drupal_get_css();
    // Add an optional title to the end of the breadcrumb.
    if (theme_get_setting('zen_breadcrumb_title') && $vars['breadcrumb']) {
        $vars['breadcrumb'] = substr($vars['breadcrumb'], 0, -6) . $vars['title'] . '</div>';
    }
    // Don't display empty help from node_help().
    if ($vars['help'] == "<div class=\"help\"><p></p>\n</div>") {
        $vars['help'] = '';
    }
    // Optionally disabled the primary and secondary links.
    if (!theme_get_setting('zen_primary_links')) {
        $vars['primary_links'] = '';
    }
    if (!theme_get_setting('zen_secondary_links')) {
        $vars['secondary_links'] = '';
    }
    // Classes for body element. Allows advanced theming based on context
    // (home page, node of certain type, etc.)
    $classes = array();
    $classes[] = $vars['is_front'] ? 'front' : 'not-front';
    $classes[] = $vars['logged_in'] ? 'logged-in' : 'not-logged-in';
    if ($vars['node']->type) {
        // If on an individual node page, put the node type in the body classes
        $classes[] = 'node-type-' . $vars['node']->type;
    }
    if ($vars['sidebar_left'] && $vars['sidebar_right']) {
        $classes[] = 'two-sidebars';
    } elseif ($vars['sidebar_left']) {
        $classes[] = 'one-sidebar sidebar-left';
    } elseif ($vars['sidebar_right']) {
        $classes[] = 'one-sidebar sidebar-right';
    } else {
        $classes[] = 'no-sidebars';
    }
    if (!$vars['is_front']) {
        // Add unique class for each page.
        $path = drupal_get_path_alias($_GET['q']);
        $classes[] = zen_id_safe('page-' . $path);
        // Add unique class for each website section.
        list($section, ) = explode('/', $path, 2);
        if (arg(0) == 'node') {
            if (arg(1) == 'add') {
                $section = 'node-add';
            } elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) {
                $section = 'node-' . arg(2);
            }
        }
        $classes[] = zen_id_safe('section-' . $section);
    }
    $vars['body_classes_array'] = $classes;
    $vars['body_classes'] = implode(' ', $classes);
    // Concatenate with spaces.
}