You are here

8 未定义的变量

admin 的头像
Submitted by admin on 星期五, 2015-09-18 01:53

作者:老葛,北京亚艾元软件有限责任公司,http://www.yaiyuan.com

问题的地址:http://drupal.org/node/1863864。当使用普通用户,或者匿名用户访问时,总是报这样的错误信息:

Notice: Undefined variable: contextual_links in include() (line 34 of D:\xampp\htdocs\breadcrumb3\sites\all\modules\breadcrumb2\breadcrumb.tpl.php

我检查了一下breadcrumb.tpl.php,原来是一个笔误。不过此时我已经发布了beta3版了。真是汗颜啊。都beta3了,还存在这样的问题。这是修正后的样子:

<?php if (!empty($breadcrumb)): ?>

<div class="breadcrumb-wrapper contextual-links-region">

  <h2 class="element-invisible">   <?php print t('You are here'); ?>  </h2>

   <?php if (!empty($contextual_links)): ?> 

    <div style='height:10px'> <?php print $contextual_links; ?> </div>

  <?php endif; ?>

  <?php //print drupal_render($contextual_link); ?>

  <div class="breadcrumb"> <?php print implode(' » ', $breadcrumb); ?> </div>

</div>

<?php endif; ?>

你开始的时候,看出来哪里出错了吗?还是读到这里才看出来这个错误。这就是beta4版。


Drupal版本: