Drupal 主题的表现形式
2024-08-31 01:26:23
1、template.php
/**
* Implements hook_theme().
*/
function yourtheme_theme($existing, $type, $theme, $path) {
$base = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'yourtheme') . '/templates/forms',
);
return array(
'commerce_checkout_form_checkout' => $base + array(
'template' => 'commerce-checkout-form-checkout',
),
);
}
/**
* Preprocessor for commerce_checkout_form_checkout theme.
*/
function yourtheme_preprocess_commerce_checkout_form_checkout(&$variables) {
/* Add or modify your variables */
}
2、/templates/forms/commerce-checkout-form-checkout.tpl.php
// Render or hide parts of $form: var_export($form);
// Example given:
hide($form['title']);
print render($form['first']);
// Render remaining form elements as usual.
print drupal_render_children($form);
最新文章
- 约瑟夫问题(java实现)
- 网络抓包工具-Wireshark学习资料
- PHP中GPC
- 《孙子算经》之";物不知数";题:中国剩余定理
- VS2010编译Qt5.4.0静态库
- 258. Add Digits
- <;span>; <;div>; 局部 keydown ,keyup事件。页面部分div $(document) 无效,可能焦点,添加焦点。
- HTML5 Canvas 绘制时钟
- Visualsvn Server的搭建
- spring 入门笔记(一)
- IOS成长之路-Nsstring中搜索方法rangeOfString
- POJ1845 数论 二分快速取余
- Android 常用代码片小结
- 初识Python装饰器
- UVA - 11090 - Going in Cycle!!(二分+差分约束系统)
- Hdoj 1847.Good Luck in CET-4 Everybody! 题解
- 详细说明进程管理工具htop、vmstat等相关命令
- Redis-Sentinel 哨兵
- 读vue-0.6-observer.js源码
- ftrace利器之trace-cmd和kernelshark