Drupal主题: 此版本与Drupal 7.x不兼容应当予以替换。

新建了一个Drupal主题,拿drupal6的稍微做了一些修改,没有想到出现这样的提示: 此版本与Drupal 7.x不兼容应当予以替换。

 
This version is not compatible with Drupal 7.x and should be replaced.
 
把info文件中的 设置为7.x core = 7.x
去掉了engine = phptemplate
清空缓存还是不行.
 
后来通过搜索找到了一篇文章: http://drupal.org/node/785714,同样的问题.
原因是因为在Drupal7中,content区域是必须声明的.
regions[content] = Content
 
加上这一句后,主题就可以启用了.Drupal7的主题info文件,才发现里面也有不少的变更.
 

Drupal版本:

Notice:undefined variable: title in include(....block.tpl.php)

Notice:undefined variable: title in include(....block.tpl.php)

从一个第3方主题里面拷贝过来的代码,它的里面有title变量,而Drupal自己没有提供这个变量.把这个变量替换为$block->subject.
代码如下:
 
<?php print render($title_prefix); ?>
 
<?php if ($block->subject): ?>
   
<h2<?php print $title_attributes; ?>>
<?php print $block->subject; ?></h2>
 
<?php endif; ?>
 
<?php print render($title_suffix); ?>

错误提示消失,新的区块模板,首先是地位降低了,核心主题里面没有了自己的block模板,其次显示一个变量的时候,需要使用render函数,后在在其它地方也是如此。