drupal中的自定义页面 [英] Custom page in drupal
问题描述
我是 drupal 的新手,我想知道如何添加自定义页面以显示来自数据库的一些信息,我已经在核心 php 中创建了该页面(例如 information.php),但我想要在drupal 7中添加该页面怎么可能
hi i m new to drupal i want to know that how could i add my custom page for the display the some information which is come from databases, i have create that page in core php (for example information.php)but i want to add that page in drupal 7 how it is possible
寻找快速和最佳的回复
推荐答案
最快的方法是向你的drupal站点添加内容类型Information",将你的information.php文件重命名为node--information.tpl.php并使用 Drupal 数据库 API 从您的数据库中获取内容.最后,您需要将 node--information.tpl.php 放入您的 theme/%themename/templates/文件夹中,并添加内容类型为Information"的新内容.
The quickest way would be to add a content type "Information" to your drupal site, rename your information.php file to node--information.tpl.php and use the Drupal Database API to get stuff from your database. Finally you'd want to put node--information.tpl.php in your theme/%themename/templates/ folder and add new content with the Content Type "Information".
最好的方法是制作一个新模块.构建您的菜单结构并添加一个调用模板文件的主题功能.使用 theme() 调用模板文件时,传递需要显示的数据.
The best way would be to make a new module. Build your menu structure and add a theming function that calls a template file. When calling the template file using theme(), pass along the data that needs to be displayed.
此外,您可能还想查看自定义页面模块:http://drupal.org/project/custompage
In addition you might want to check out the Custom Page module: http://drupal.org/project/custompage
这篇关于drupal中的自定义页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!