Skip to content
Snippets Groups Projects

Implement creation of normal menu link as parent of a default tab

Closes #3467262

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
390 // name based upon the altering.
391 $links[$menu_link_id] = [
392 'route_name' => $this->getRouteName(),
393 // Identify URL embedded arguments and correlate them to a handler.
394 'load arguments' => [$this->view->storage->id(), $this->display['id'], '%index'],
395 'id' => $menu_link_id,
396 ];
397 if (!isset($tab_options['menu_name'])) {
398 [$tab_options['menu_name'], $tab_options['parent']] = explode(':', $tab_options['parent'] ?? '', 2);
399 }
400 $links[$menu_link_id]['title'] = $tab_options['title'] ?? '';
401 $links[$menu_link_id]['description'] = $tab_options['description'] ?? '';
402 $links[$menu_link_id]['parent'] = $tab_options['parent'] ?? '';
403
404 if (isset($menu['weight'])) {
405 $links[$menu_link_id]['weight'] = intval($menu['weight']);
  • 385 elseif ($menu['type'] == 'default tab') {
    386 $tab_options = $this->getOption('tab_options');
    387 if ($tab_options['type'] === 'normal') {
    388 $links[$menu_link_id] = [];
    389 // Some views might override existing paths, so we have to set the route
    390 // name based upon the altering.
    391 $links[$menu_link_id] = [
    392 'route_name' => $this->getRouteName(),
    393 // Identify URL embedded arguments and correlate them to a handler.
    394 'load arguments' => [$this->view->storage->id(), $this->display['id'], '%index'],
    395 'id' => $menu_link_id,
    396 ];
    397 if (!isset($tab_options['menu_name'])) {
    398 [$tab_options['menu_name'], $tab_options['parent']] = explode(':', $tab_options['parent'] ?? '', 2);
    399 }
    400 $links[$menu_link_id]['title'] = $tab_options['title'] ?? '';
    • Title and description are not being taken from this config because they're dynamically taken from the view in Drupal\views\Plugin\Menu\ViewsMenuLink.

      It might be necessary to add some logic there to determine from where the title and description are calculated.

    • Please register or sign in to reply
  • Pablo López added 1 commit

    added 1 commit

    • 4cab1fca - Issue #3467262: For a page display designated "Default menu tab" a parent menu link is not created

    Compare with previous version

  • Pablo López added 1 commit

    added 1 commit

    • 55b20cb9 - Issue #3467262: For a page display designated "Default menu tab" a parent menu link is not created

    Compare with previous version

  • Pablo López added 1 commit

    added 1 commit

    Compare with previous version

  • Pablo López added 460 commits

    added 460 commits

    Compare with previous version

  • Pablo López added 1 commit

    added 1 commit

    Compare with previous version

  • Pablo López added 138 commits

    added 138 commits

    • 5658c11b...017ad48a - 137 commits from branch project:11.x
    • 7ad3f7ce - Merge remote-tracking branch 'origin/11.x' into 3467262-for-a-page

    Compare with previous version

  • Pablo López added 1 commit

    added 1 commit

    Compare with previous version

  • Pablo López added 1 commit

    added 1 commit

    Compare with previous version

  • Pablo López added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading