English 中文(简体)
Drupal面板,缺少编辑面板选项卡
原标题:Drupal panels, edit panel tabs is missing

当我切换主题时,我注意到了一些奇怪的事情。在花环里,我可以看到风景;编辑面板选项卡按钮;但当我切换回我的自定义主题时,它就消失了。

我已经有选项卡行:

<?php if ($tabs): print  <ul class="tabs primary"> . $tabs . </ul></div> ; endif; ?>

但它只是没有出现。为什么?

以下是page.tpl.php的一些代码:

    <div class="main-container">
<div class="mcontent">
        <div id="content-header">
      <?php if ($mission): print  <div id="mission"> . $mission . </div> ; endif; ?>
      <?php if ($tabs): print  <div id="tabs-wrapper" class="clear-block"> ; endif; ?>
      <?php if ($title): print  <h2 . ($tabs ?   class="with-tabs"  :   ) . > . $title . </h2> ; endif; ?>
      <?php if ($tabs): print  <ul class="tabs primary"> . $tabs . </ul></div> ; endif; ?>
      <?php if ($tabs2): print  <ul class="tabs secondary"> . $tabs2 . </ul> ; endif; ?>
      <?php if ($show_messages && $messages): print $messages; endif; ?>
      <?php print $help; ?>
        </div> <!-- /#content-header -->

<?php print $content; ?> 
</div>
</div>
问题回答

到目前为止,我已经在相当多的自定义主题中使用了该代码,没有任何问题。

如果不看网站/你的代码,很难知道,但有几种可能性:

  • clearing your cache (Performance > Clear site cache)
  • making sure the $tabs variable is in page.tpl.php, not node.tpl.php etc.

其他事情可能是(但如果其他主题有效,可能不会):

  • your user doesn t have permissions to use that input format (PHP code, Full HTML etc)
  • the session isn t working or you ve been logged out while on those pages (of course you will see this right away if, for example, your admin menu shows up. I ve seen it happen on some setups, though)

通常,要么代码放错了地方,要么被隐藏/遮挡(通过CSS/页面格式),要么用户没有查看它的权限。

如果以上都不起作用,您可能需要重建权限(在Drupal 6中,内容管理>;后期设置>;重建权限),或者尝试启用现有权限,看看这是否是罪魁祸首。

我雇佣了一个人来解决这个问题,下面是所做的:

    <?php
/**
* Override of theme_menu_local_tasks().
* Add argument to allow primary/secondary local tasks to be printed
* separately. Use theme_links() markup to consolidate.
*/
function kidstoria_menu_local_tasks($type =   ) {
  if (module_exists( ctools )) {

    if ($primary = ctools_menu_primary_local_tasks()) {
        $primary = $primary;
      }
      if ($secondary = ctools_menu_secondary_local_tasks()) {
        $secondary = $secondary;
      }
  }
  else
  {

    if ($primary = menu_primary_local_tasks()) {
        $primary = $primary;
      }
      if ($secondary = menu_secondary_local_tasks()) {
        $secondary = $secondary;
      }

  }

  switch ($type) {
    case  primary :
      return $primary;
    case  secondary :
      return $secondary;
    default:
      return $primary . $secondary;
  }
}




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签