Skip to content

The Seven theme moves both the primary and secondary tabs into the header #6930

@avpaderno

Description

@avpaderno

The Seven themes uses the following hook, which moves primary and secondary tabs into the header section.

function seven_preprocess_layout(&$variables) {
  // Don't modify layouts that are being edited.
  if (!$variables['admin']) {
    // Move the page title and tabs into the "header" area, to fit with Seven's
    // markup requirements.
    if (isset($variables['content']['header'])) {
      if ($variables['title']) {
        $title = '<h1 class="page-title">' . $variables['title'] . '</h1>';
        $variables['content']['header'] .= $title;
        $variables['title'] = NULL;
      }
      if ($variables['tabs']) {
        $tabs = '<div class="tabs">' . $variables['tabs'] . '</div>';
        $variables['content']['header'] .= $tabs;
        $variables['tabs'] = NULL;
      }
    }
  }

The effect is that tabs in pages like /admin/content/comment appear as in the following screenshot.

Image

The tabs should be instead rendered as in the following screenshot.

Image

When there are just primary tabs, all is fine.

Image

(I fixed the second screenshot, which was not the correct one.)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions