Custom page in drupal

2019-08-26 20:13发布

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

标签: drupal-7
1条回答
做自己的国王
2楼-- · 2019-08-26 20:46

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

查看更多
登录 后发表回答