定制页面在drupal [英] Custom page in drupal

查看:308
本文介绍了定制页面在drupal的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如何添加我的自定义页面来显示来自数据库的一些信息,我已经在核心PHP(例如information.php)中创建了该页面,但是我想要添加该页面在drupal 7如何可能



寻找快速和最好的回复

解决方案

最快的方法是将内容类型信息添加到您的drupal站点,将您的information.php文件重命名为node - information.tpl.php,并使用Drupal Database API获取内容从你的数据库。最后你想把node-information.tpl.php放在你的主题/%themename / templates /文件夹中,并添加内容类型信息的新内容。



<最好的方式是制作一个新的模块。构建菜单结构并添加调用模板文件的主题功能。当使用theme()调用模板文件时,请传递需要显示的数据。



此外,您可能需要查看自定义页面模块: http://drupal.org/project/custompage


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

looking for the quick and best reply

解决方案

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".

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.

In addition you might want to check out the Custom Page module: http://drupal.org/project/custompage

这篇关于定制页面在drupal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆