简体   繁体   English

挂钩Drupal 7中的基本页面

[英]Hooking basic pages in drupal 7

I have few basic pages in drupal 7, named about, contacts. 在drupal 7中,我仅有几篇关于联系人的基本页面。 I tried to make page--about, and style it, but it doesnt work. 我试图制作页面-关于它并设置其样式,但是它不起作用。 Any advice on how to force hook basic pages? 关于如何强制挂钩基本页面的任何建议?

In your themes template file you can get template suggestions. 在主题模板文件中,您可以获得模板建议。 This was you can check there isnt anything weird going on. 这是您可以检查是否没有任何奇怪的事情。 The following will dump out suggestions for templates. 以下内容将转储有关模板的建议。

You need to use the following: 您需要使用以下内容:

function YOURTHEME_process_page(&$vars) {
    var_dump($vars['theme_hook_suggestions']);
    dsm($vars['theme_hook_suggestions']); //if you have Devel
}

You should install the Devel module, this helps alot with theming. 您应该安装Devel模块,这有助于进行主题设置。

First make sure you're using the correct machine name for your content type. 首先,请确保您为内容类型使用了正确的计算机名称。 Go to content types and copy it from there. 转到内容类型,然后从那里复制。

Copy the node.tpl.php file from root/modules/nodes/ to your theme's templates directory. 将node.tpl.php文件从root/modules/nodes/复制到主题的模板目录。

Rename the node.tpl.php file to node--MACHINE_NAME.tpl.php . node.tpl.php文件重命名为node--MACHINE_NAME.tpl.php

Clear the cache in admin/performance/ . 清除admin/performance/的缓存。 This is important. 这个很重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM