I am trying to achive something like explained in this article - http://www.leveltendesign.com/blog/tom/quick-enhancements-make-drupal-co... - though I want to do it via panels and views.

I have created a page on admin/dashboard and another page on admin/dashboard/short_courses

They work when I go to the different urls. However, I cannot get it to show them with tabs and subtabs, so I could have one page with an overview and tabs switching to other contexts.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lsolesen’s picture

FileSize
158.96 KB

See also this attached screenshot where it has been created as tabs?

lsolesen’s picture

Export of the dashboard main page.

$page = new stdClass;
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'dashboard';
$page->task = 'page';
$page->admin_title = 'Dashboard';
$page->admin_description = 'Dashboard is a task based backend administration';
$page->path = 'admin/dashboard';
$page->access = array(
  'plugins' => array(
    0 => array(
      'name' => 'role',
      'settings' => array(
        'rids' => array(
          0 => 3,
          1 => 5,
          2 => 6,
          3 => 7,
        ),
      ),
      'context' => 'logged-in-user',
      'not' => FALSE,
    ),
  ),
  'logic' => 'and',
);
$page->menu = array(
  'type' => 'normal',
  'title' => 'Mit dashboard',
  'name' => 'management',
  'weight' => '-100',
  'parent' => array(
    'type' => 'none',
    'title' => '',
    'name' => 'navigation',
    'weight' => '0',
  ),
);
$page->arguments = array();
$page->conf = array(
  'admin_paths' => FALSE,
);
$page->default_handlers = array();
$handler = new stdClass;
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_dashboard_panel_context';
$handler->task = 'page';
$handler->subtask = 'dashboard';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
  'title' => 'Dashboard',
  'no_blocks' => 0,
  'pipeline' => 'ipe',
  'css_id' => '',
  'css' => '',
  'contexts' => array(),
  'relationships' => array(),
);
$display = new panels_display;
$display->layout = 'twocol_stacked';
$display->layout_settings = array();
$display->panel_settings = array();
$display->cache = array();
$display->title = 'Dit dashboard';
$display->content = array();
$display->panels = array();
  $pane = new stdClass;
  $pane->pid = 'new-1';
  $pane->panel = 'top';
  $pane->type = 'views';
  $pane->subtype = 'workbench_recent_content';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array(
    'override_pager_settings' => 0,
    'use_pager' => 0,
    'nodes_per_page' => '10',
    'pager_id' => '0',
    'offset' => '0',
    'more_link' => 1,
    'feed_icons' => 0,
    'panel_args' => 0,
    'link_to_view' => 0,
    'args' => '',
    'url' => '',
    'display' => 'block_1',
    'override_title' => 0,
    'override_title_text' => '',
  );
  $pane->cache = array();
  $pane->style = array();
  $pane->css = array();
  $pane->extras = array();
  $pane->position = 0;
  $pane->locks = array();
  $display->content['new-1'] = $pane;
  $display->panels['top'][0] = 'new-1';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = 'new-1';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;

Export of the subpage

$page = new stdClass;
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'short_courses';
$page->task = 'page';
$page->admin_title = 'Short courses';
$page->admin_description = 'Short courses';
$page->path = 'admin/dashboard/short_courses';
$page->access = array(
  'plugins' => array(
    0 => array(
      'name' => 'role',
      'settings' => array(
        'rids' => array(
          0 => 3,
          1 => 5,
          2 => 6,
          3 => 7,
        ),
      ),
      'context' => 'logged-in-user',
      'not' => FALSE,
    ),
  ),
  'logic' => 'and',
);
$page->menu = array(
  'type' => 'tab',
  'title' => 'Korte kurser',
  'name' => 'management',
  'weight' => '-100',
  'parent' => array(
    'type' => 'none',
    'title' => '',
    'name' => 'navigation',
    'weight' => '0',
  ),
);
$page->arguments = array();
$page->conf = array(
  'admin_paths' => FALSE,
);
$page->default_handlers = array();
$handler = new stdClass;
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_short_courses_panel_context';
$handler->task = 'page';
$handler->subtask = 'short_courses';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
  'title' => 'Korte kurser',
  'no_blocks' => 0,
  'pipeline' => 'ipe',
  'css_id' => '',
  'css' => '',
  'contexts' => array(),
  'relationships' => array(),
);
$display = new panels_display;
$display->layout = 'twocol_stacked';
$display->layout_settings = array();
$display->panel_settings = array();
$display->cache = array();
$display->title = 'Korte kurser';
$display->content = array();
$display->panels = array();
  $pane = new stdClass;
  $pane->pid = 'new-1';
  $pane->panel = 'top';
  $pane->type = 'views';
  $pane->subtype = 'short_courses';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array(
    'override_pager_settings' => 0,
    'use_pager' => 1,
    'nodes_per_page' => '50',
    'pager_id' => '0',
    'offset' => '0',
    'more_link' => 1,
    'feed_icons' => 0,
    'panel_args' => 0,
    'link_to_view' => 0,
    'args' => '',
    'url' => '',
    'display' => 'block_all_short_courses',
    'override_title' => 0,
    'override_title_text' => '',
  );
  $pane->cache = array();
  $pane->style = array();
  $pane->css = array();
  $pane->extras = array();
  $pane->position = 0;
  $pane->locks = array();
  $display->content['new-1'] = $pane;
  $display->panels['top'][0] = 'new-1';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = '0';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;
merlinofchaos’s picture

Status: Active » Fixed

Change the path on the 'admin/dashboard' page to 'admin/dashboard/default' (or something, the 'default' keyword will be invisible and is your choice). Change the menu type to 'default tab'. Save everything. Short of bugs in the core menu system, that should work okay.

lsolesen’s picture

Status: Fixed » Closed (fixed)

That worked like a charm.

lsolesen’s picture

Status: Closed (fixed) » Active

How can I create the subtabs (the small grey tabs beneath the tabs). In views I tried just making a menu tab and putting the path like this. I choose the menu tab (not the standard menu tab).

/admin/dashboard/default/subtab-name

lsolesen’s picture

Tried all sorts of combinations.

1) Found out that I needed to create at least two views as subtabs to get the subtabs showing. That makes little sense on a panels page, as it is rendered with something completely different. But that is probably how Drupal works internally?

2) Could not find any way to add the subtabs to the default tab for some reason.

Is that about right?

lsolesen’s picture

Closing old support questions. If this is still important to you, please reopen.