开发者

Drupal panels, 'edit panel' tabs is missing

开发者 https://www.devze.com 2023-03-09 14:27 出处:网络
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 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">
        <d开发者_StackOverflow中文版iv 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'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.


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

精彩评论

暂无评论...
验证码 换一张
取 消