Drupal 7 Template Suggestions
来源:互联网 发布:bose musicmonitor知乎 编辑:程序博客网 时间:2024/04/30 10:46
<?php
//template.php
// Add a single suggestion for nodes that have the "Promoted to front page" box checked.
function drop_preprocess_node(&$variables) {
if ($variables['promote']) {
// looks for node--promoted.tpl.php in your theme directory
$variables['theme_hook_suggestion'] = 'node__promoted';
}
}
// Add multiple suggestions for pages based on the logged in user's roles.
function drop_preprocess_page(&$variables) {
global $user;
if (!empty($user->roles)) {
foreach ($user->roles as $role) {
$filter = '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s';
$string_clean = preg_replace($filter, '-', drupal_strtolower($role));
// looks for page--[role].tpl.php in your theme directory
// ex: page--administrator.tpl.php
$variables['theme_hook_suggestions'][] = 'page__'. $string_clean;
}
}
}
?>
- Drupal 7 Template Suggestions
- drupal模块——content template
- 建议 Suggestions建议 Suggestions
- 升级drupal 核心(drupal 6/7)
- Google Suggestions
- AJAX Suggestions
- no suggestions
- drupal 7全局变量
- Pro Drupal 7 Development
- Drupal 7 Views Relationships
- Drupal 7 Rules
- Drupal 7 开发实用工具
- drupal 7全局变量
- drupal 7全局变量
- Drupal 7 Ajax 应用
- Drupal 7 Site Map
- Drupal 7一站式建站
- Drupal 7事务操作
- 学习第二天
- 创建自己的 OSM.Planet 街道级别地图服务器,汉化地名避免万国语
- Redis内存存储结构分析
- SA权限沙合模式提权方法
- luaplus 与官方文档慢慢扯(五)
- Drupal 7 Template Suggestions
- Unix 网络编程 函数
- java高新技术
- Write a method to replace all spaces in a string with ‘%20’.
- vim plugin
- 在windows7中u盘安装ubuntu
- luaplus 与官方文档慢慢扯(六)
- 深恶痛绝……残忍虐杀何时终止?
- 2448