- 🇺🇸United States smustgrave
Closing this as outdated as additional information was requested in #18 3 years ago.
If still a valid task please reopen addressing the point and updating issue summary following the default template.
Thanks!
Issue
#1847198: Update the structure returned by hook_toolbar() →
is an intermediary step between the initial, simple architecture of hook_toolbar
and ultimately the flexible, easy to use architecture that we know is possible. Many of the improvements proposed in this ticket were originally suggest by sun in
#1847198-62: Update the structure returned by hook_toolbar() →
.
Any solution we put together should take this issue into account: #1852346: [discussion, no patch] Toolbar UI regression: shortcuts and menu not visible at same time →
Contextual
Menu (?)
Search (?)
Shortcut
Tour
User
I10n_client: http://drupal.org/project/l10n_client
Interactive Information Bar (IIB): http://drupal.org/project/iib
Responsive Preview: http://drupal.org/project/responsive_preview
User Facing Navigation Bar:
https://www.drupal.org/project/navbar_userfacing →
Workbench: http://drupal.org/project/workbench
In #1847198-62: Update the structure returned by hook_toolbar() → , sun asks:
Why aren't the toolbar tabs/items not plugins, just like toolbar tray/block content plugins, too?
And provides the following stub code:
<?php
core/modules/user/lib/Drupal/user/Plugin/toolbar/tab/Account.php:
namespace Drupal/user/Plugin/toolbar/tab;
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Menu\MenuBlock;
use Drupal\toolbar\ToolbarTab;
/**
* User account toolbar tab.
*
* @Plugin(
* id = "user_account",
* label = @Translation("User account"),
* module = "user",
* renderTrayWithTab = false
* )
*/
class Account extends ToolbarTab {
/**
* Implements ToolbarTabInterface::access().
*/
public function access() {
// Only applicable to authenticated users.
return !empty($GLOBALS['user']->uid);
}
/**
* Implements ToolbarTabInterface::buildTab().
*/
public function buildTab() {
$build = array(
'#...' => '...',
);
return $build;
}
/**
* Implements ToolbarTabInterface::buildTray().
*/
public function buildTray() {
$settings = array(
'menu_name' => 'account',
'max_depth' => 1,
);
return new MenuBlock($settings);
}
}
?>
Ideally, but moving toolbar item/tray declarations to plugins, we can leverage existing content via blocks already defined in Drupal, e.g. menus.
What we're looking to do here is further refine the toolbar item declaration architecture so it leverages more sub-systems and uses less custom code.
No UX changes.
TBD
Closed: outdated
10.1 ✨
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Closing this as outdated as additional information was requested in #18 3 years ago.
If still a valid task please reopen addressing the point and updating issue summary following the default template.
Thanks!