Drupal 面板、“编辑面板”;标签缺失

发布于 2024-11-10 16:28:36 字数 1202 浏览 2 评论 0原文

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

我已经有选项卡行:

<?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>

I noticed something odd when I switch themes. In garland, I can see the view & 'edit panel' tab buttons; but when I switch back to my custom theme, it disappears.

I already have the tabs line:

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

But it's just not appearing. Why is that?

Here is some of the code for 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

窗影残 2024-11-17 16:28:37

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

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

  • 清除缓存(性能 > 清除站点缓存)
  • 确保 $tabs 变量位于 page.tpl.php 中,不是 node.tpl.php 等。

它可能是其他东西(但如果其他主题正常工作则可能不是):

  • 您的用户无权使用该输入格式(PHP 代码、完整 HTML 等) )
  • 会话无法正常工作或您在这些页面上时已注销(当然,如果您的管理菜单出现,您会立即看到这一点。不过,我已经在某些设置中看到过这种情况)

通常,代码位于错误的地方,它被隐藏/模糊(通过 CSS/页面格式),或者该人没有查看它的权限。

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

I've used that code in quite a few custom themes without any issues so far.

It's hard to know without seeing the site/your code, but a couple of possibilities:

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

Other things it could be (but maybe not if other themes are working):

  • 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)

Usually, either the code is in the wrong place, it's being hidden/obscured (by CSS/page formatting), or the person doesn't have the permissions to view it.

If none of the above work, you may want to rebuild permissions (in Drupal 6, Content Management > Post Settings > Rebuild Permissions), or play with enabling existing permissions to see if that's the culprit.

你的笑 2024-11-17 16:28:37

我雇了人来解决这个问题,这是所做的事情:

    <?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;
  }
}

I hired someone to fix the issue, here is what is done:

    <?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;
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文