Drupal 6个独特的身体类
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Drupal 6个独特的身体类相关的知识,希望对你有一定的参考价值。
Automatically add a class to the body tag on each page. Remember to add
/** * Override or insert phpTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { // Add unique classes for each page and website section $path = drupal_get_path_alias($_GET['q']); // append the body classes array with the current path $body_classes[] = phptemplate_format_class('page-' . $path); // set body_classes var with spaces in between each class if (module_exists('path')) { if ( $alias != $_GET['q'] && $alias == $_REQUEST['q'] ) { $template_filename = 'page'; $template_filename = $template_filename . '-' . $path_part; $suggestions[] = $template_filename; } } $vars['template_files'] = $suggestions; } } //Helper Function for formatting css class names function phptemplate_format_class($string) { }
以上是关于Drupal 6个独特的身体类的主要内容,如果未能解决你的问题,请参考以下文章