Quantcast
Viewing all articles
Browse latest Browse all 291721

Convert drupal_get_breadcrumb() and drupal_set_breadcrumb() to a service, convert breadcrumbs output to a block.

Sub-task of #1889790: [Meta] Allow modules to register links for menus, breadcrumbs and tabs (if not with hook_menu)

Problem/Motivation

Breadcrumbs use a static pattern but should be updated to a service to get the functions out of the global scope.
Breadcrumbs are a sticking point in the panel-ish controller conversion.

Proposed resolution

Create a service to manage breadcrumbs
Create a block for breadcrumbs that has the service injected.
Place this block in the appropriate region in standard install profile.

Remaining tasks

Create the class and register the service
Write the block plugin
Write the standard.install integration

User interface changes

Breadcrumbs becomes a block

API changes

drupal_get_breadcrumb and drupal_set_breadcrumb
would become

<?php
Drupal
::service('breadcrumb')->get()
?>
and
<?php
Drupal
::service('breadcrumb')->set()
?>
respectively.

Add

<?php
Drupal
::service('breadcrumb')->append()
?>
and
<?php
Drupal
::service('breadcrumb')->insert()
?>
methods to make it easier to work with.

Viewing all articles
Browse latest Browse all 291721

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>