Získání argumentů z URL:
$url = arg(); print_r($url); //print $url[0] .'|'. $url[1];
Získání query parametrů z URL:
$query = drupal_get_query_parameters(); //print_r $query; print $query['page'];
Doplnění počtu položek menu:
/** * Process variables for menu-block-wrapper.tpl.php. * * @see menu-block-wrapper.tpl.php */ function THEMENAME_preprocess_menu_block_wrapper(&$variables) { //$variables['classes_array'][] = 'menu-block-' . $variables['delta']; $variables['classes_array'][] = 'menu-level-count-'. count(element_children($variables['content'])); }
Připojení CSS pro Internet Explorer:
/** * Generates IE CSS links for LTR and RTL languages. */ function phptemplate_get_ie_styles() { global $language; $iecss = "\n"; $iecss .= '<!--[if (lte IE 7)&(gte IE 5)]>'."\n "; $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-7.css" />'."\n "; if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-7-rtl.css" />'."\n "; } $iecss .= '<![if lt IE 7]>'."\n "; $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-6.css" />'."\n "; if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-6-rtl.css" />'."\n "; } $iecss .= '<![if lt IE 6]>'."\n "; $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-5.5.css" />'."\n "; if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-5.5-rtl.css" />'."\n "; } $iecss .= '<![if lt IE 5.5]>'."\n "; $iecss .= '<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-5.css" />'."\n "; if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) { $iecss .= " ".'<link type="text/css" rel="stylesheet" media="screen, projection" href="'. base_path() . path_to_theme() .'/styles/ie-5-rtl.css" />'."\n "; } $iecss .= '<![endif]>'."\n "; $iecss .= '<![endif]>'."\n "; $iecss .= '<![endif]>'."\n"; $iecss .= '<![endif]-->'."\n"; return $iecss; }