initial commit of starter install drupal 7
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
|
||||
$vars['attributes']['class']='block block-'. $vars['block']->module .' '. (isset($vars['skinr']) ? $vars['skinr'] : '');
|
||||
$vars['attributes']['id'] = 'block-'. $vars['block']->module .'-'. $vars['block']->delta;
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file template.preprocess-comment-wrapper.inc
|
||||
*/
|
||||
|
||||
global $theme;
|
||||
|
||||
$classes = array();
|
||||
|
||||
# Add support for Skinr module classes http://drupal.org/project/skinr
|
||||
if (function_exists('node_skinr_data') && !empty($vars['skinr'])) {
|
||||
$classes[] = $vars['skinr'];
|
||||
}
|
||||
|
||||
# Class for content types: "forum-comments", "blog-comments", etc.
|
||||
$vars['classes'] .= ' '. $vars['node']->type .'-comments';
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
//dsm($vars);
|
||||
|
||||
$vars['theme_hook_suggestions'][] = 'field__' . $vars['element']['#view_mode'];
|
||||
$vars['theme_hook_suggestions'][] = 'field__' . $vars['element']['#field_type'] . '__' . $vars['element']['#view_mode'];
|
||||
$vars['theme_hook_suggestions'][] = 'field__' . $vars['element']['#field_name'] . '__' . $vars['element']['#view_mode'];
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
if (module_exists('rdf')) {
|
||||
$vars['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
|
||||
$vars['rdf_profile'] = ' profile="' . $vars['grddl_profile'] . '"';
|
||||
}
|
||||
else {
|
||||
$vars['doctype'] = '<!DOCTYPE html>' . "\n";
|
||||
$vars['rdf_profile'] = '';
|
||||
}
|
||||
|
||||
|
||||
# Add mobile meta tags to $head ADD this to your subtheme
|
||||
$heads = array();
|
||||
|
||||
$heads['HandheldFriendly'] = array(
|
||||
'#tag' => 'meta',
|
||||
'#attributes' => array(
|
||||
'name' => 'HandheldFriendly',
|
||||
'content' => 'true',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
# Mobile Viewport Fix
|
||||
# j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
|
||||
# device-width : Occupy full width of the screen in its current orientation
|
||||
# initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
|
||||
# maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width
|
||||
|
||||
$heads['viewport'] = array(
|
||||
'#tag' => 'meta',
|
||||
'#attributes' => array(
|
||||
'name' => 'viewport',
|
||||
'content' => 'width=device-width,initial-scale=1',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
# Add these icons links to your sub theme
|
||||
# or Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references
|
||||
|
||||
// $head[] = '<link rel="apple-touch-icon" sizes="72x72" href="'. base_path() . path_to_theme() .'/touch-icon-ipad.png'.'"/>' . "\n";
|
||||
// $head[] = '<link rel="apple-touch-icon" sizes="114x114" href="'. base_path() . path_to_theme() .'/touch-icon-iphone4.png'.'"/>' . "\n";
|
||||
|
||||
$heads['icon'] = array(
|
||||
'#tag' => 'link',
|
||||
'#attributes' => array(
|
||||
'href' => base_path() . path_to_theme() .'/icon.png',
|
||||
'rel' => 'shortcut icon',
|
||||
'type' => 'image/png',
|
||||
),
|
||||
);
|
||||
|
||||
$heads['apple-touch-icon'] = array(
|
||||
'#tag' => 'link',
|
||||
'#attributes' => array(
|
||||
'href' => base_path() . path_to_theme() .'/apple-touch-icon.png',
|
||||
'rel' => 'apple-touch-icon',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($heads as $type=>$head)
|
||||
drupal_add_html_head($head, $type);
|
||||
|
||||
|
||||
|
||||
// $vars['head'] = implode('', $head);
|
||||
|
||||
|
||||
# add body classes
|
||||
if(isset($vars['node'])){
|
||||
|
||||
# from taxonomy
|
||||
foreach ($vars['node']->taxonomy as $tid => $term) {
|
||||
$vars['classes_array'][] = 'term-vid-'. $term->vid .' term-tid-'. $tid;
|
||||
}
|
||||
|
||||
# from menu
|
||||
$mlid = db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s'", 'node/'. $vars['node']->nid));
|
||||
// Now get the menu related information.
|
||||
if (!empty($mlid) || !empty($node->menu['mlid']) || !empty($node->menu['plid'])) {
|
||||
$menu_link = menu_link_load($mlid);
|
||||
// krumo($menu_link);
|
||||
$vars['classes_array'][] = ' mlid-'. $menu_link['mlid'] .' plid-'. $menu_link['plid'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# theme layout settings
|
||||
|
||||
// if(isset($vars['page']['sidebar_first']) && isset($vars['page']['sidebar_second'])){
|
||||
// $layout = 'two-sidebars';
|
||||
// }else if(isset($vars['page']['sidebar_first']) || isset($vars['page']['sidebar_second'])){
|
||||
// $layout = isset($vars['page']['sidebar_first']) ? 'sidebar-first' : 'sidebar-second';
|
||||
// }else{
|
||||
// $layout = 'no-sidebar';
|
||||
// }
|
||||
// $vars['classes_array'][] = $layout;
|
||||
|
||||
// if (theme_get_setting('layout_enable_settings') == 'on') {
|
||||
// $method = theme_get_setting('layout_method');
|
||||
// $vars['method'] = $method;
|
||||
// $vars['classes_array'][] .= ' layout-method-'.$method;
|
||||
|
||||
// }
|
||||
|
||||
// $vars['off_canvas_menu'] = block_get_blocks_by_region('off_canvas_menu');
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
// dsm($vars);
|
||||
|
||||
$vars['theme_hook_suggestions'][] = 'node__'.$vars['view_mode'];
|
||||
$vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode'];
|
||||
|
||||
if(!isset($vars["title_attributes_array"]["class"]))
|
||||
$vars["title_attributes_array"]["class"] = array();
|
||||
|
||||
$vars["title_attributes_array"]["class"][] = "node-title";
|
||||
$vars["title_attributes_array"]["class"] = implode(" ", $vars["title_attributes_array"]["class"]);
|
||||
|
||||
$vars["title_attributes"] = drupal_attributes($vars["title_attributes_array"]);
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file template.preprocess-page.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Override or insert variables into page templates.
|
||||
*
|
||||
* @param $vars
|
||||
* A sequential array of variables to pass to the theme template.
|
||||
* @param $hook
|
||||
* The name of the theme function being called.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
# set variables for the logo and slogan (from Deco drupal 6.x theme)
|
||||
$site_fields = array();
|
||||
if ($vars['site_name']) {
|
||||
$site_fields[] = check_plain($vars['site_name']);
|
||||
}
|
||||
// if ($vars['site_slogan']) {
|
||||
// $site_fields[] = check_plain($vars['site_slogan']);
|
||||
// }
|
||||
|
||||
$vars['site_title'] = '<h1 id="site-name"><a href="'.$vars["front_page"].'">'. implode(' ', $site_fields) .'</a></h1>';
|
||||
|
||||
|
||||
|
||||
if (theme_get_setting('layout_enable_settings') == 'on')
|
||||
$vars['method'] = theme_get_setting('layout_method');
|
||||
|
||||
|
||||
$vars['primary_local_tasks'] = menu_primary_local_tasks();
|
||||
$vars['secondary_local_tasks'] = menu_secondary_local_tasks();
|
||||
|
||||
|
||||
if($vars['is_front'])
|
||||
$vars['title'] = false;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$vars['attributes_array']['id'] = str_replace('_', '-',$vars['region']);
|
||||
Reference in New Issue
Block a user