Commit d98c3bb1 authored by Quan Nguyen's avatar Quan Nguyen

push custom breadcrumb module

parent 9a0a919c
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "75d7d453c2d0621df49776ec65aa1d55",
"content-hash": "ac59bc355f548e3ddc274cea247055d3",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -1226,6 +1226,73 @@
"source": "https://git.drupalcode.org/project/csv_serialization"
}
},
{
"name": "drupal/custom_breadcrumbs",
"version": "1.0.0-alpha1",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/custom_breadcrumbs.git",
"reference": "1.0.0-alpha1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/custom_breadcrumbs-1.0.0-alpha1.zip",
"reference": "1.0.0-alpha1",
"shasum": "1a89f33be922e687662ae47d9a9b7c41e995139f"
},
"require": {
"drupal/core": "^8 || ^9",
"drupal/token": "^1.0"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "1.0.0-alpha1",
"datestamp": "1594887609",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "Szczepan Musial (lamp5)",
"homepage": "https://www.drupal.org/u/lamp5",
"role": "Maintainer"
},
{
"name": "Contributors",
"homepage": "https://www.drupal.org/node/98576/committers",
"role": "Contributors"
},
{
"name": "colan",
"homepage": "https://www.drupal.org/user/58704"
},
{
"name": "lamp5",
"homepage": "https://www.drupal.org/user/2870321"
},
{
"name": "thePanz",
"homepage": "https://www.drupal.org/user/58689"
}
],
"description": "Custom breadcrumbs helps the user to create and manage breadcrumbs menu on all content entity pages and other like views, page manager, controllers.",
"homepage": "https://www.drupal.org/project/custom_breadcrumbs",
"keywords": [
"Drupal"
],
"support": {
"source": "http://cgit.drupalcode.org/custom_breadcrumbs",
"issues": "https://www.drupal.org/project/issues/custom_breadcrumbs"
}
},
{
"name": "drupal/easy_breadcrumb",
"version": "1.13.0",
......@@ -1305,6 +1372,75 @@
"issues": "https://www.drupal.org/project/issues/easy_breadcrumb"
}
},
{
"name": "drupal/token",
"version": "1.7.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/token.git",
"reference": "8.x-1.7"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/token-8.x-1.7.zip",
"reference": "8.x-1.7",
"shasum": "c7e3a3757282e4c94e3c1fff08d01e22155cb853"
},
"require": {
"drupal/core": "^8.8 || ^9"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.7",
"datestamp": "1589314266",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"drush": {
"services": {
"drush.services.yml": "^9 || ^10"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "Berdir",
"homepage": "https://www.drupal.org/user/214652"
},
{
"name": "Dave Reid",
"homepage": "https://www.drupal.org/user/53892"
},
{
"name": "eaton",
"homepage": "https://www.drupal.org/user/16496"
},
{
"name": "fago",
"homepage": "https://www.drupal.org/user/16747"
},
{
"name": "greggles",
"homepage": "https://www.drupal.org/user/36762"
},
{
"name": "mikeryan",
"homepage": "https://www.drupal.org/user/4420"
}
],
"description": "Provides a user interface for the Token API, some missing core tokens.",
"homepage": "https://www.drupal.org/project/token",
"support": {
"source": "https://git.drupalcode.org/project/token"
}
},
{
"name": "drupal/views_data_export",
"version": "1.0.0",
......
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
INTRODUCTION
------------
Custom breadcrumbs helps the user to create and manage breadcrumbs menu on all
content entity pages and other like views, page manager, controllers.
REQUIREMENTS
------------
This module requires the following modules:
* Tokens (https://www.drupal.org/project/tokens)
INSTALLATION
------------
* Install as you would normally install a contributed Drupal module. Visit
https://www.drupal.org/node/1897420 for further information.
CONFIGURATION
-------------
* Configure the user permissions in Administration » People » Permissions:
* Customize the basic breadcrumbs settings in Configuration » User interface » Custom breadcrumbs settings
* You can add a new breadcrumbs instances in Structure » Custom breadcrumbs
USAGE
-------------
* go to Structure » Custom breadcrumbs and add a new breadcrumbs instance
* you can create breadcrumbs for your entities like nodes or pages using path
* remember to check "Enabled" status
* setup urls and titles, one per line
* you can use an extra vars like <nolink> or <term_hierarchy:field_name> to attach taxonomy tree to breadcrumbs
* if you want to use query value from token, for example for search results,
you have to define extra cache contexts ```url.query_args:search``` where search is your query key
* On every content type manage display page, you can display breadcrumbs like field,
this solution has been designed for displaying breadcrumbs on node teaser display mode in
search results.
MAINTAINERS
-----------
Current maintainers:
* Szczepan Musial (lamp5) - https://www.drupal.org/u/lamp5
This project has been sponsored by:
* Abventor
A Drupal Development Team Who Deliver.
We create flexible solutions that companies and organizations from around the world use.
{
"name": "drupal/custom_breadcrumbs",
"type": "drupal-module",
"description": "Custom breadcrumbs helps the user to create and manage breadcrumbs menu on all content entity pages and other like views, page manager, controllers.",
"keywords": [
"Drupal"
],
"license": "GPL-2.0+",
"homepage": "https://www.drupal.org/project/custom_breadcrumbs",
"authors": [
{
"name": "Szczepan Musial (lamp5)",
"homepage": "https://www.drupal.org/u/lamp5",
"role": "Maintainer"
},
{
"name": "Contributors",
"homepage": "https://www.drupal.org/node/98576/committers",
"role": "Contributors"
}
],
"support": {
"issues": "https://www.drupal.org/project/issues/custom_breadcrumbs",
"source": "http://cgit.drupalcode.org/custom_breadcrumbs"
},
"require": {
"drupal/token": "^1.0"
}
}
home: TRUE
home_link: "Home"
current_page: TRUE
current_page_link: FALSE
trim_title: 0
custom_breadcrumbs.custom_breadcrumbs.*:
type: config_entity
label: Custom breadcrumbs
mapping:
id:
type: string
label: ID
label:
type: label
label: Label
uuid:
type: string
description:
type: string
entityType:
type: string
entityBundle:
type: string
language:
type: string
breadcrumbPaths:
type: string
breadcrumbTitles:
type: string
type:
type: string
pathPattern:
type: string
custom_breadcrumbs.settings:
type: config_object
label: 'Custom breadcrumbs settings'
mapping:
home:
label: 'Home'
type: boolean
home_link:
label: 'Home link'
type: string
current_page:
label: 'Current page'
type: boolean
current_page_link:
label: 'Current page link'
type: boolean
trim_title:
label: 'Trim title'
type: integer
name: Custom breadcrumbs
type: module
description: 'Provides a custom breadcrumbs configuration entity.'
package: Custom
core: 8.x
core_version_requirement: ^8 || ^9
configure: custom_breadcrumbs.config
dependencies:
- token:token
# Information added by Drupal.org packaging script on 2020-07-16
version: '1.0.0-alpha1'
project: 'custom_breadcrumbs'
datestamp: 1594887610
entity.custom_breadcrumbs.add_form:
route_name: 'entity.custom_breadcrumbs.add_form'
title: 'Add custom breadcrumbs'
appears_on:
- entity.custom_breadcrumbs.collection
entity.custom_breadcrumbs.overview:
title: Custom breadcrumbs
parent: system.admin_structure
description: 'List of custom breadcrumbs to extend site functionality.'
route_name: entity.custom_breadcrumbs.collection
custom_breadcrumbs.settings:
title: Custom breadcrumbs settings
route_name: custom_breadcrumbs.config
parent: system.admin_config_ui
<?php
/**
* @file
* Primary module hooks for Custom breadcrumbs module.
*
* @DCG
* This file is no longer required in Drupal 8.
* @see https://www.drupal.org/node/2217931
*/
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatch;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function custom_breadcrumbs_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.custom_breadcrumbs':
$text = file_get_contents(dirname(__FILE__) . '/README.md');
if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
return '<pre>' . $text . '</pre>';
}
else {
// Use the Markdown filter to render the README.
$filter_manager = \Drupal::service('plugin.manager.filter');
$settings = \Drupal::configFactory()
->get('markdown.settings')
->getRawData();
$config = ['settings' => $settings];
$filter = $filter_manager->createInstance('markdown', $config);
return $filter->process($text, 'en');
}
}
return NULL;
}
/**
* Implements hook_entity_extra_field_info().
*/
function custom_breadcrumbs_entity_extra_field_info() {
$extra = [];
$entity_types = \Drupal::entityTypeManager()->getDefinitions();
$entityBundleInfo = \Drupal::service('entity_type.bundle.info');
foreach ($entity_types as $key => $type) {
foreach ($entityBundleInfo->getBundleInfo($key) as $bundle_key => $bundle_name) {
$extra[$key][$bundle_key]['display']['breadcrumbs'] = [
'label' => t('Breadcrumbs'),
'description' => t('Breadcrumbs'),
'weight' => 100,
'visible' => FALSE,
];
}
}
return $extra;
}
/**
* Implements hook_entity_view().
*/
function custom_breadcrumbs_entity_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
if ($display->getComponent('breadcrumbs')) {
$url = $entity->toUrl();
$router = \Drupal::service('router.no_access_checks');
$result = $router->match($url->toString());
$paramsObj = [];
foreach ($result as $key => $val) {
if (isset($url->getRouteParameters()[$key])) {
$paramsObj[$key] = $val;
}
}
$route_match = new RouteMatch($url->getRouteName(), $result['_route_object'], $paramsObj, $url->getRouteParameters());
$build['breadcrumbs'] = \Drupal::service('breadcrumb')
->build($route_match)
->toRenderable();
}
}
administer custom_breadcrumbs:
title: 'Administer custom breadcrumbs'
entity.custom_breadcrumbs.collection:
path: '/admin/structure/custom-breadcrumbs'
defaults:
_entity_list: 'custom_breadcrumbs'
_title: 'Custom breadcrumbs configuration'
requirements:
_permission: 'administer custom_breadcrumbs'
entity.custom_breadcrumbs.add_form:
path: '/admin/structure/custom_breadcrumbs/add'
defaults:
_entity_form: 'custom_breadcrumbs.add'
_title: 'Add a custom breadcrumb'
requirements:
_permission: 'administer custom_breadcrumbs'
entity.custom_breadcrumbs.edit_form:
path: '/admin/structure/custom-breadcrumbs/{custom_breadcrumbs}'
defaults:
_entity_form: 'custom_breadcrumbs.edit'
_title: 'Edit a custom breadcrumb'
requirements:
_permission: 'administer custom_breadcrumbs'
entity.custom_breadcrumbs.delete_form:
path: '/admin/structure/custom-breadcrumbs/{custom_breadcrumbs}/delete'
defaults:
_entity_form: 'custom_breadcrumbs.delete'
_title: 'Delete a custom breadcrumb'
requirements:
_permission: 'administer custom_breadcrumbs'
custom_breadcrumbs.config:
path: '/admin/config/user-interface/custom-breadcrumbs'
defaults:
_form: '\Drupal\custom_breadcrumbs\Form\CustomBreadcrumbsSettingsForm'
_title: 'Custom breadcrumb settings'
requirements:
_permission: 'administer custom_breadcrumbs'
services:
custom_breadcrumbs.breadcrumb:
class: Drupal\custom_breadcrumbs\BreadcrumbBuilder
arguments: ['@config.factory', '@entity_type.manager', '@language_manager', '@request_stack', '@title_resolver', '@token', '@path_alias.manager', '@path.matcher']
tags:
- { name: breadcrumb_builder, priority: 1003 }
<?php
namespace Drupal\custom_breadcrumbs;
use Drupal\path_alias\AliasManagerInterface;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Controller\TitleResolverInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Link;
use Drupal\Core\Path\PathMatcherInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\Core\Utility\Token;
use Drupal\custom_breadcrumbs\Entity\CustomBreadcrumbs;
use Drupal\custom_breadcrumbs\Form\CustomBreadcrumbsForm;
use Drupal\taxonomy\TermInterface;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Class BreadcrumbBuilder.
*
* @package Drupal\abv_app
*/
class BreadcrumbBuilder implements BreadcrumbBuilderInterface {
/**
* Custom breadcrumbs settings.
*
* @var array
*/
protected $customBreadcrumbsSettings;
/**
* EntityTypeManager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Language manager.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* Current request.
*
* @var \Symfony\Component\HttpFoundation\Request|null
*/
protected $currentRequest;
/**
* Token.
*
* @var \Drupal\Core\Utility\Token
*/
protected $token;
/**
* Title resolver.
*
* @var \Drupal\Core\Controller\TitleResolverInterface
*/
protected $titleResolver;
/**
* Alias Manager.
*
* @var \Drupal\Core\Path\AliasManagerInterface
*/
protected $aliasManager;
/**
* Path matcher.
*
* @var \Drupal\Core\Path\PathMatcherInterface
*/
protected $pathMatcher;
/**
* BreadcrumbBuilder constructor.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
* Config factory.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* EntityTypeManager service.
* @param \Drupal\Core\Language\LanguageManagerInterface $languageManager
* LanguageManager service.
* @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
* Request stack.
* @param \Drupal\Core\Controller\TitleResolverInterface $titleResolver
* Title resolver.
* @param \Drupal\Core\Utility\Token $token
* Token.
* @param \Drupal\path_alias\AliasManagerInterface $aliasManager
* Alias manager.
* @param \Drupal\Core\Path\PathMatcherInterface $pathMatcher
* Path matcher.
*/
public function __construct(ConfigFactoryInterface $configFactory,
EntityTypeManagerInterface $entityTypeManager,
LanguageManagerInterface $languageManager,
RequestStack $requestStack,
TitleResolverInterface $titleResolver,
Token $token,
AliasManagerInterface $aliasManager,
PathMatcherInterface $pathMatcher) {
$this->entityTypeManager = $entityTypeManager;
$this->languageManager = $languageManager;
$this->token = $token;
$this->customBreadcrumbsSettings = $configFactory->get('custom_breadcrumbs.settings')
->getRawData();
$this->titleResolver = $titleResolver;
$this->currentRequest = $requestStack->getCurrentRequest();
$this->aliasManager = $aliasManager;
$this->pathMatcher = $pathMatcher;
}
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function build(RouteMatchInterface $route_match) {
$breadcrumb = new Breadcrumb();
// Set up homepage link.
if ($this->customBreadcrumbsSettings['home'] && !$this->pathMatcher->isFrontPage()) {
$breadcrumb->addLink(Link::createFromRoute($this->customBreadcrumbsSettings['home_link'], '<front>'));
}
// Prepare all route parameters.
$params = $route_match->getParameters()->all();
// Check breadcrumbs by patch.
if ($breadcrumbSetting = $this->matchPaths($route_match)) {
$this->applyBreadcrumb($breadcrumb, $breadcrumbSetting, NULL);
}
else {
// Set up breadcrumbs by content entity configs.
$this->applyContentEntityBreadcrumb($breadcrumb, $route_match);
}
// Set up the last current page crumb.
if ($this->customBreadcrumbsSettings['current_page'] && !$this->pathMatcher->isFrontPage()) {
$title = '';
$route = '<none>';
$route_parameters = $route_parameters_link = [];
foreach ($params as $key => $value) {
if ($value instanceof ContentEntityInterface) {
$route_parameters_link[$key] = $value->id();
$title = $value->label();
}
}
if ($this->customBreadcrumbsSettings['current_page_link']) {
$route = $route_match->getRouteName();
$route_parameters = $route_parameters_link;
}
// Title resolver works good when you render breadcrumb on full page,
// when we attach breadcrumb on node teaser, it doesn't work.
if (empty($title)) {
$title = $this->titleResolver->getTitle($this->currentRequest, $route_match->getRouteObject());
}
$breadcrumb->addLink(Link::createFromRoute($this->prepareTitle($title), $route, $route_parameters));
}
$breadcrumb->addCacheContexts(['url.path']);
return $breadcrumb;
}
/**
* Added breadcrumbs based content entity.
*
* @param \Drupal\Core\Breadcrumb\Breadcrumb $breadcrumb
* Breadcrumb.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* Route match.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
protected function applyContentEntityBreadcrumb(Breadcrumb &$breadcrumb, RouteMatchInterface $route_match) {
// Prepare all route parameters.
$params = $route_match->getParameters()->all();
$entityTypeIds = array_keys($params);
$entityTypeId = reset($entityTypeIds);
$entity = isset($params[$entityTypeId]) ? $params[$entityTypeId] : NULL;
$breadcrumbSettings = $this->entityTypeManager->getStorage('custom_breadcrumbs')
->loadByProperties([
'entityType' => $entityTypeId,
'status' => TRUE,
]);
$this->filterPerBundle($breadcrumbSettings, $route_match);
$this->filterPerLanguage($breadcrumbSettings);
$breadcrumbSetting = reset($breadcrumbSettings);
if ($breadcrumbSetting) {
$this->applyBreadcrumb($breadcrumb, $breadcrumbSetting, $entity);
}
}
/**
* Apply breadcrumb per settings.
*
* @param \Drupal\Core\Breadcrumb\Breadcrumb $breadcrumb
* Breadcrumb object.
* @param \Drupal\custom_breadcrumbs\Entity\CustomBreadcrumbs $customBreadcrumbs
* Breadcrumb settings.
* @param mixed $entity
* Entity.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
protected function applyBreadcrumb(Breadcrumb &$breadcrumb, CustomBreadcrumbs $customBreadcrumbs, $entity) {
$paths = $customBreadcrumbs->getMultiValues('breadcrumbPaths');
$titles = $customBreadcrumbs->getMultiValues('breadcrumbTitles');
$extraContexts = $customBreadcrumbs->getMultiValues('extraCacheContexts');
$token_vars = [];
if ($entity instanceof EntityInterface) {
$token_vars = [CustomBreadcrumbsForm::getTokenEntity($entity->getEntityTypeId()) => $entity];
}
foreach ($paths as $key => $path) {
if (isset($titles[$key])) {
$href = file_url_transform_relative($this->token->replace($path, $token_vars, ['clear' => TRUE]));
$link_title = $this->token->replace($titles[$key], $token_vars, ['clear' => TRUE]);
// Skip empty href, for example when token is empty.
if (empty($href) || empty($link_title)) {
continue;
}
if ($href === '<nolink>') {
$link = Link::createFromRoute($this->prepareTitle($link_title), $href);
$breadcrumb->addLink($link);
}
else {
if ($this->checkHierarchyToken($href)) {
$field_name = explode(':', $href)[1];
$field_name = str_replace('>', '', $field_name);
if ($entity instanceof EntityInterface) {
if ($entity->hasField($field_name)) {
$term = $entity->get($field_name)->entity;
if ($term instanceof TermInterface) {
$parents = $this->getAllParents($term->id());
foreach (array_reverse($parents) as $parent) {
$link = $parent->toLink($this->prepareTitle($parent->label()));
$breadcrumb->addLink($link);
$breadcrumb->addCacheableDependency($parent);
}
}
}
}
continue;
}
else {
$url = Url::fromUserInput($href);
$link = Link::fromTextAndUrl($this->prepareTitle($link_title), $url);
$breadcrumb->addLink($link);
}
}
$breadcrumb->addCacheableDependency($entity);
$breadcrumb->addCacheableDependency($customBreadcrumbs);
}
}
if (array_filter($extraContexts)) {
$breadcrumb->addCacheContexts($extraContexts);
}
}
/**
* Get term parents.
*
* @param int $tid
* Term id.
*
* @return mixed
* List of entities.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
protected function getAllParents($tid) {
return $this->entityTypeManager->getStorage("taxonomy_term")
->loadAllParents($tid);
}
/**
* Check token.
*
* @param string $href
* Token string.
*
* @return bool
* True or false.
*/
protected function checkHierarchyToken($href) {
if (strpos($href, '<term_hierarchy:') !== FALSE) {
return TRUE;
}
return FALSE;
}
/**
* Helper function for filter available settings per bundle.
*
* @param array $settings
* Array of settings.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* Route match.
*/
protected function filterPerBundle(array &$settings, RouteMatchInterface $route_match) {
$params = $route_match->getParameters()->all();
$entity = reset($params);
if ($entity instanceof EntityInterface) {
$bundle = $entity->bundle();
foreach ($settings as $key => $setting) {
if ($setting->get('entityBundle') !== $bundle) {
unset($settings[$key]);
}
}
}
}
/**
* Helper function for filter available settings per language.
*
* @param array $settings
* Array of settings.
*/
protected function filterPerLanguage(array &$settings) {
$currentLanguage = $this->languageManager->getCurrentLanguage();
$und = [];
foreach ($settings as $key => $setting) {
if ($setting->get('language') === LanguageInterface::LANGCODE_NOT_SPECIFIED) {
$und[$key] = $setting;
}
if ($setting->get('language') !== $currentLanguage->getId()) {
unset($settings[$key]);
}
}
if (empty($settings)) {
$settings = $und;
}
}
/**
* Check breadcrumbs by path.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* Route match.
*
* @return bool|\Drupal\Core\Entity\EntityInterface
* CustomBreadcrumb entity or False.
*
* @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
*/
protected function matchPaths(RouteMatchInterface $route_match) {
$breadcrumbSettingsIDs = $this->entityTypeManager->getStorage('custom_breadcrumbs')
->getQuery()
->condition('pathPattern', '', '<>')
->condition('status', TRUE)
->execute();
$breadcrumbSettings = CustomBreadcrumbs::loadMultiple(array_keys($breadcrumbSettingsIDs));
$url = Url::fromRouteMatch($route_match);
foreach ($breadcrumbSettings as $breadcrumbSetting) {
$aliases = [];
$aliases[] = $this->aliasManager->getAliasByPath('/' . $url->getInternalPath(), $breadcrumbSetting->get('language'));
$aliases[] = '/' . $url->getInternalPath();
$pattern = $breadcrumbSetting->get('pathPattern');
foreach ($aliases as $alias) {
if ($this->pathMatcher->matchPath($alias, $pattern)) {
return $breadcrumbSetting;
}
}
}
return FALSE;
}
/**
* Helper method to trim title.
*
* @param string $title
* Title.
*
* @return string
* Substring.
*/
private function prepareTitle($title) {
if ($length = $this->customBreadcrumbsSettings['trim_title']) {
// We should catch the case when title is array or object.
if (is_string($title) && strlen($title) > $length) {
return substr($title, 0, $length) . '...';
}
}
return $title;
}
}
<?php
namespace Drupal\custom_breadcrumbs;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
/**
* Provides an interface defining a custom breadcrumbs entity type.
*/
interface CustomBreadcrumbsInterface extends ConfigEntityInterface {
}
<?php
namespace Drupal\custom_breadcrumbs;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
/**
* Provides a listing of custom breadcrumbs.
*/
class CustomBreadcrumbsListBuilder extends ConfigEntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['label'] = $this->t('Label');
$header['entityType'] = $this->t('Entity type');
$header['entityBundle'] = $this->t('Entity bundle');
$header['language'] = $this->t('Language');
$header['status'] = $this->t('Status');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\custom_breadcrumbs\CustomBreadcrumbsInterface $entity */
$row['label'] = $entity->label();
$row['entityType'] = $entity->get('entityType');
$row['entityBundlee'] = $entity->get('entityBundle');
$row['language'] = $entity->get('language');
$row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled');
return $row + parent::buildRow($entity);
}
}
<?php
namespace Drupal\custom_breadcrumbs\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\custom_breadcrumbs\CustomBreadcrumbsInterface;
/**
* Defines the custom breadcrumbs entity type.
*
* @ConfigEntityType(
* id = "custom_breadcrumbs",
* label = @Translation("Custom breadcrumbs"),
* label_collection = @Translation("Custom breadcrumbs"),
* label_singular = @Translation("custom breadcrumb"),
* label_plural = @Translation("custom breadcrumbs"),
* label_count = @PluralTranslation(
* singular = "@count custom breadcrumb",
* plural = "@count custom breadcrumbs",
* ),
* handlers = {
* "list_builder" =
* "Drupal\custom_breadcrumbs\CustomBreadcrumbsListBuilder",
* "form" = {
* "add" = "Drupal\custom_breadcrumbs\Form\CustomBreadcrumbsForm",
* "edit" = "Drupal\custom_breadcrumbs\Form\CustomBreadcrumbsForm",
* "delete" = "Drupal\Core\Entity\EntityDeleteForm"
* }
* },
* config_prefix = "custom_breadcrumbs",
* admin_permission = "administer custom_breadcrumbs",
* links = {
* "collection" = "/admin/structure/custom-breadcrumbs",
* "add-form" = "/admin/structure/custom-breadcrumbs/add",
* "edit-form" =
* "/admin/structure/custom-breadcrumbs/{custom_breadcrumbs}",
* "delete-form" =
* "/admin/structure/custom-breadcrumbs/{custom_breadcrumbs}/delete"
* },
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid"
* },
* config_export = {
* "id",
* "label",
* "status",
* "description",
* "entityType",
* "entityBundle",
* "language",
* "breadcrumbPaths",
* "breadcrumbTitles",
* "type",
* "pathPattern",
* "extraCacheContexts"
* }
* )
*/
class CustomBreadcrumbs extends ConfigEntityBase implements CustomBreadcrumbsInterface {
/**
* The custom breadcrumb ID.
*
* @var string
*/
protected $id;
/**
* The custom breadcrumb label.
*
* @var string
*/
protected $label;
/**
* The custom breadcrumb status.
*
* @var bool
*/
protected $status;
/**
* The custom_breadcrumbs description.
*
* @var string
*/
protected $description;
/**
* The entity type.
*
* @var string
*/
protected $entityType;
/**
* The entity bundle.
*
* @var string
*/
protected $entityBundle;
/**
* Language.
*
* @var string
*/
protected $language;
/**
* Breadcrum paths.
*
* @var string
*/
protected $breadcrumbPaths;
/**
* The breadcrumb titles.
*
* @var string
*/
protected $breadcrumbTitles;
/**
* Type of breadcrumb.
*
* @var string
*/
protected $type;
/**
* Path pattern.
*
* @var string
*/
protected $pathPattern;
/**
* Extra cache contexts.
*
* @var string
*/
protected $extraCacheContexts;
/**
* Helper function to get values and split per one line.
*
* @param string $field
* Field name.
*
* @return array|false|string[]
* Values form field.
*/
public function getMultiValues($field) {
return preg_split('/\r\n|\r|\n/', $this->get($field));
}
}
<?php
namespace Drupal\custom_breadcrumbs\Form;
use Drupal\Core\Entity\ContentEntityType;
use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Custom breadcrumbs form.
*
* @property \Drupal\custom_breadcrumbs\CustomBreadcrumbsInterface $entity
*/
class CustomBreadcrumbsForm extends EntityForm {
/**
* EntityTypeBundleInfo.
*
* @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface
*/
protected $entityTypeBundleInfo;
/**
* Language interface.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* CustomBreadcrumbsForm constructor.
*
* @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entityTypeBundleInfo
* EntityTypeBundleInfo service.
* @param \Drupal\Core\Language\LanguageManagerInterface $languageManager
* LanguageManager service.
*/
public function __construct(EntityTypeBundleInfoInterface $entityTypeBundleInfo, LanguageManagerInterface $languageManager) {
$this->entityTypeBundleInfo = $entityTypeBundleInfo;
$this->languageManager = $languageManager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity_type.bundle.info'),
$container->get('language_manager')
);
}
/**
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$form['label'] = [
'#type' => 'textfield',
'#title' => $this->t('Label'),
'#maxlength' => 255,
'#default_value' => $this->entity->label(),
'#description' => $this->t('Label for the custom breadcrumb.'),
'#required' => TRUE,
];
$form['id'] = [
'#type' => 'machine_name',
'#default_value' => $this->entity->id(),
'#machine_name' => [
'exists' => '\Drupal\custom_breadcrumbs\Entity\CustomBreadcrumbs::load',
],
'#disabled' => !$this->entity->isNew(),
];
$form['status'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enabled'),
'#default_value' => $this->entity->status(),
];
$form['description'] = [
'#type' => 'textarea',
'#title' => $this->t('Description'),
'#default_value' => $this->entity->get('description'),
'#description' => $this->t('Description of the custom breadcrumb.'),
];
$form['type'] = [
'#type' => 'select',
'#title' => $this->t('Type of breadcrumb'),
'#options' => [
1 => $this->t('Content entity'),
2 => $this->t('Path'),
],
'#requires' => TRUE,
'#default_value' => $this->entity->get('type'),
];
$entity = $this->entity->get('entityType');
$entity = ($form_state->hasValue('entityType')) ? $form_state->getValue('entityType') : $entity;
$form['entityType'] = [
'#type' => 'select',
'#title' => $this->t('Entity type'),
'#default_value' => $entity,
'#description' => $this->t('Select your entity type.'),
'#options' => $this->getEntityTypes(),
'#empty_value' => '_none',
'#ajax' => [
'callback' => [$this, 'ajaxCallback'],
'wrapper' => 'entity_bundle_configuration',
'method' => 'replace',
'effect' => 'fade',
],
'#states' => [
'visible' => [
':input[name="type"]' => ['value' => '1'],
],
],
];
$form['entityBundle'] = [
'#prefix' => '<div id="entity_bundle_configuration">',
'#suffix' => '</div>',
'#type' => 'select',
'#title' => $this->t('Entity bundle'),
'#default_value' => $this->entity->get('entityBundle'),
'#description' => $this->t('Select your entity bundle.'),
'#options' => $this->getEntityBundle($entity),
'#empty_value' => '_none',
'#states' => [
'visible' => [
':input[name="type"]' => ['value' => '1'],
],
],
];
$form['language'] = [
'#type' => 'select',
'#title' => $this->t('Language'),
'#default_value' => $this->entity->get('language'),
'#description' => $this->t('Select language'),
'#options' => $this->getAvailableLanguages(),
];
$form['pathPattern'] = [
'#type' => 'textarea',
'#title' => $this->t('Path pattern'),
'#default_value' => $this->entity->get('pathPattern'),
'#description' => $this->t('A set of patterns separated by a newline.'),
'#states' => [
'visible' => [
':input[name="type"]' => ['value' => '2'],
],
],
];
$form['breadcrumbPaths'] = [
'#type' => 'textarea',
'#title' => $this->t('Breadcrumb paths'),
'#default_value' => $this->entity->get('breadcrumbPaths'),
'#required' => TRUE,
'#description' => $this->t('One url per line, you can use <a href="@token">Token</a> module. Url should start from "/".', ['@token' => 'https://www.drupal.org/project/token']),
];
$form['breadcrumbTitles'] = [
'#type' => 'textarea',
'#title' => $this->t('Breadcrumb titles'),
'#default_value' => $this->entity->get('breadcrumbTitles'),
'#required' => TRUE,
'#description' => $this->t('One title per line, you can use <a href="@token">Token</a> module.', ['@token' => 'https://www.drupal.org/project/token']),
];
$form['extraCacheContexts'] = [
'#type' => 'textarea',
'#title' => $this->t('Extra cache contexts'),
'#default_value' => $this->entity->get('extraCacheContexts'),
'#description' => $this->t('You can define an extra cache contexts for example for curent request query "url.query_args:search".'),
];
$form['token_tree'] = [
'#theme' => 'token_tree_link',
'#token_types' => [self::getTokenEntity($entity)],
'#show_restricted' => TRUE,
'#weight' => 90,
];
$form['token_details'] = [
'#type' => 'details',
'#title' => $this->t('Custom breadcrumbs extra vars'),
'#open' => FALSE,
];
$form['token_details']['vars'] = [
'#theme' => 'item_list',
'#items' => [
$this->t('&ltnolink&gt - adds ability to create crumb without url'),
$this->t('&ltterm_hierarchy:field_name&gt - taxonomy term field with hierarchy'),
],
];
return $form;
}
/**
* Get token type by entity.
*
* @param string $entity_type
* Entity type.
*
* @return string
* Array of token types.
*/
public static function getTokenEntity($entity_type) {
if ($entity_type === 'taxonomy_term') {
return 'term';
}
return $entity_type;
}
/**
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state) {
$result = parent::save($form, $form_state);
$message_args = ['%label' => $this->entity->label()];
$message = $result == SAVED_NEW
? $this->t('Created new custom breadcrumb %label.', $message_args)
: $this->t('Updated custom breadcrumb %label.', $message_args);
$this->messenger()->addStatus($message);
$form_state->setRedirectUrl($this->entity->toUrl('collection'));
return $result;
}
/**
* Ajax callback for the entity bundle dependent configuration options.
*
* @param array $form
* Form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* Form State.
*
* @return array
* The form element containing the entity bundle options.
*/
public static function ajaxCallback(array &$form, FormStateInterface $form_state) {
return $form['entityBundle'];
}
/**
* Get all available content entity types.
*
* @return array
* Array of entity types.
*/
private function getEntityTypes() {
$options = [];
$options['_none'] = $this->t('Select entity type');
$types = $this->entityTypeManager->getDefinitions();
foreach ($types as $key => $type) {
if ($type instanceof ContentEntityType && $type->getLinkTemplates('canocical')) {
$options[$key] = $type->getLabel();
}
}
return $options;
}
/**
* Get list of entity bundle.
*
* @param string $entity
* Entity type.
*
* @return array
* Array of values.
*/
private function getEntityBundle($entity) {
$options = [];
$options['_none'] = $this->t('Select entity bundle');
foreach ($this->entityTypeBundleInfo->getBundleInfo($entity) as $key => $type) {
$options[$key] = $type['label'];
}
return $options;
}
/**
* Get all available languages.
*
* @return array
* Array of available languages.
*/
private function getAvailableLanguages() {
$options = ['und' => $this->t('Language not specified')];
$langs = $this->languageManager->getLanguages(LanguageInterface::STATE_CONFIGURABLE);
foreach ($langs as $key => $lang) {
$options[$key] = $lang->getName();
}
return $options;
}
}
<?php
namespace Drupal\custom_breadcrumbs\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Configure Custom breadcrumb settings for this site.
*/
class CustomBreadcrumbsSettingsForm extends ConfigFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'custom_breadcrumbs_settings';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return ['custom_breadcrumbs.settings'];
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('custom_breadcrumbs.settings');
$form['home'] = [
'#type' => 'checkbox',
'#title' => $this->t('Prepend default "Home" link'),
'#default_value' => $config->get('home'),
];
$form['home_link'] = [
'#type' => 'textfield',
'#title' => $this->t('"Home" text'),
'#default_value' => $config->get('home_link'),
'#states' => [
'visible' => [
'input[name="home"]' => ['checked' => TRUE],
],
],
];
$form['current_page'] = [
'#type' => 'checkbox',
'#title' => $this->t('Append curent page title like the latest crumb'),
'#default_value' => $config->get('current_page'),
];
$form['current_page_link'] = [
'#type' => 'checkbox',
'#title' => $this->t('Last crumb with link'),
'#default_value' => $config->get('current_page_link'),
'#states' => [
'visible' => [
'input[name="current_page"]' => ['checked' => TRUE],
],
],
];
$form['trim_title'] = [
'#type' => 'number',
'#title' => $this->t('Trim title length'),
'#default_value' => $config->get('trim_title'),
'#min' => 0,
];
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('custom_breadcrumbs.settings')
->set('home', $form_state->getValue('home'))
->set('home_link', $form_state->getValue('home_link'))
->set('current_page', $form_state->getValue('current_page'))
->set('current_page_link', $form_state->getValue('current_page_link'))
->set('trim_title', $form_state->getValue('trim_title'))
->save();
parent::submitForm($form, $form_state);
}
}
File mode changed from 100644 to 100755
<?php
namespace Drupal\token;
use Drupal\Core\Field\EntityReferenceFieldItemList;
use Drupal\Core\TypedData\ComputedItemListTrait;
/**
* Defines a menu link list class for storen menu link information.
*
* @see token_entity_base_field_info()
*/
class MenuLinkFieldItemList extends EntityReferenceFieldItemList {
use ComputedItemListTrait;
/**
* {@inheritdoc}
*/
protected function computeValue() {
// This field does not really compute anything, it is used to store
// the referenced menu link.
return NULL;
}
}
<?php
namespace Drupal\token;
use Drupal\Core\Security\TrustedCallbackInterface;
use Drupal\Core\Render\Element;
class TokenFieldRender implements TrustedCallbackInterface {
/**
* {@inheritdoc}
*/
public static function trustedCallbacks() {
return ['preRender'];
}
/**
* Pre-render callback for field output used with tokens.
*/
public static function preRender($elements) {
// Remove the field theme hook, attachments, and JavaScript states.
unset($elements['#theme']);
unset($elements['#states']);
unset($elements['#attached']);
// Prevent multi-value fields from appearing smooshed together by appending
// a join suffix to all but the last value.
$deltas = Element::getVisibleChildren($elements);
$count = count($deltas);
if ($count > 1) {
$join = isset($elements['#token_options']['join']) ? $elements['#token_options']['join'] : ", ";
foreach ($deltas as $index => $delta) {
// Do not add a suffix to the last item.
if ($index < ($count - 1)) {
$elements[$delta] += ['#suffix' => $join];
}
}
}
return $elements;
}
}
......@@ -5,7 +5,7 @@ package: Testing
core_version_requirement: ^8.7.7 || ^9
hidden: TRUE
# Information added by Drupal.org packaging script on 2019-12-30
version: '8.x-1.6'
# Information added by Drupal.org packaging script on 2020-04-26
version: '8.x-1.7'
project: 'token'
datestamp: 1577708590
datestamp: 1587893591
......@@ -7,7 +7,7 @@ hidden: TRUE
dependencies:
- drupal:image
# Information added by Drupal.org packaging script on 2019-12-30
version: '8.x-1.6'
# Information added by Drupal.org packaging script on 2020-04-26
version: '8.x-1.7'
project: 'token'
datestamp: 1577708590
datestamp: 1587893591
......@@ -88,7 +88,7 @@ public function setUp($modules = []) {
'bundle' => 'article',
])->save();
entity_get_form_display('node', 'article', 'default')
\Drupal::service('entity_display.repository')->getFormDisplay('node', 'article', 'default')
->setComponent('field_body', [
'type' => 'text_textarea_with_summary',
'settings' => [
......
......@@ -3,13 +3,12 @@
namespace Drupal\Tests\token\Functional;
use Behat\Mink\Element\NodeElement;
use Drupal\node\Entity\Node;
use Drupal\Core\Url;
use Drupal\node\Entity\NodeType;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Core\Language\LanguageInterface;
use Drupal\system\Entity\Menu;
use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\system\Entity\Menu;
/**
* Tests menu tokens.
......@@ -103,7 +102,7 @@ function testMenuTokens() {
//$this->config('menu.entity.node.' . $node->getType())->set('available_menus', ['main-menu'])->save();
// Add a node menu link.
/** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $node_link */
/** @var \Drupal\menu_link_content\MenuLinkContentInterface $node_link */
$node_link = MenuLinkContent::create([
'link' => ['uri' => 'entity:node/' . $node->id()],
'title' => 'Node link',
......@@ -120,7 +119,7 @@ function testMenuTokens() {
'menu-link:menu' => 'Main menu',
'menu-link:url' => $node->toUrl('canonical', ['absolute' => TRUE])->toString(),
'menu-link:url:path' => '/node/' . $node->id(),
'menu-link:edit-url' => $node_link->url('edit-form', ['absolute' => TRUE]),
'menu-link:edit-url' => $node_link->toUrl('edit-form', ['absolute' => TRUE])->toString(),
'menu-link:parent' => 'Configuration',
'menu-link:parent:id' => $parent_link->getPluginId(),
'menu-link:parents' => 'Administration, Configuration',
......@@ -185,7 +184,7 @@ function testMenuTokens() {
// @see token_node_menu_link_submit()
$selects = $this->cssSelect('select[name="menu[menu_parent]"]');
$select = reset($selects);
$options = $this->getAllOptions($select);
$options = $select->findAll('css', 'option');
// Filter to items with title containing 'Test preview'.
$options = array_filter($options, function (NodeElement $element) {
return strpos($element->getText(), 'Test preview') !== FALSE;
......@@ -217,7 +216,7 @@ function testMenuTokens() {
$this->drupalGet('node/add/page');
$selects = $this->cssSelect('select[name="menu[menu_parent]"]');
$select = reset($selects);
$options = $this->getAllOptions($select);
$options = $select->findAll('css', 'option');
// Filter to items with title containing 'Test preview'.
$options = array_filter($options, function (NodeElement $item) {
return strpos($item->getText(), 'Child link') !== FALSE;
......@@ -251,7 +250,7 @@ function testMenuTokens() {
->sort('id', 'ASC')
->range(0, 1);
$result = $query->execute();
$this->assertTrue($result);
$this->assertNotEmpty($result);
// Create a node with a menu link and create 2 menu links linking to this
// node after. Verify that the menu link provided by the node has priority.
......
......@@ -5,12 +5,15 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Language\Language;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Tests\Traits\Core\PathAliasTestTrait;
/**
* Helper test trait with some added functions for testing.
*/
trait TokenTestTrait {
use PathAliasTestTrait;
function assertToken($type, array $data, $token, $expected, array $options = []) {
return $this->assertTokens($type, $data, [$token => $expected], $options);
}
......@@ -28,7 +31,7 @@ function assertTokens($type, array $data, array $tokens, array $options = []) {
$this->fail(t("Token value for @token was not generated.", ['@type' => $type, '@token' => $token]));
}
elseif (!empty($options['regex'])) {
$this->assertTrue(preg_match('/^' . $expected . '$/', $replacements[$token]), t("Token value for @token was '@actual', matching regular expression pattern '@expected'.", ['@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected]));
$this->assertEquals(1, preg_match('/^' . $expected . '$/', $replacements[$token]), t("Token value for @token was '@actual', matching regular expression pattern '@expected'.", ['@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected]));
}
else {
$this->assertEquals($expected, $replacements[$token], t("Token value for @token was '@actual', expected value '@expected'.", ['@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected]));
......@@ -57,13 +60,7 @@ function assertNoTokens($type, array $data, array $tokens, array $options = [])
}
function saveAlias($source, $alias, $language = Language::LANGCODE_NOT_SPECIFIED) {
$alias = [
'source' => $source,
'alias' => $alias,
'language' => $language,
];
\Drupal::service('path.alias_storage')->save($alias['source'], $alias['alias']);
return $alias;
return $this->createPathAlias($source, $alias, $language);
}
function saveEntityAlias($entity_type, EntityInterface $entity, $alias, $language = Language::LANGCODE_NOT_SPECIFIED) {
......@@ -103,7 +100,7 @@ function assertPageTokens($url, array $tokens, array $data = [], array $options
$this->fail(t('Failed to generate token @token.', ['@token' => $token]));
}
else {
$this->assertIdentical($result['values'][$token], (string) $expected, t("Token value for @token was '@actual', expected value '@expected'.", ['@token' => $token, '@actual' => $result['values'][$token], '@expected' => $expected]));
$this->assertSame($result['values'][$token], (string) $expected, t("Token value for @token was '@actual', expected value '@expected'.", ['@token' => $token, '@actual' => $result['values'][$token], '@expected' => $expected]));
}
}
}
......
......@@ -17,7 +17,7 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;
/**
* Tests field tokens.
......@@ -401,7 +401,7 @@ public function testTokenViewMode() {
'targetEntityType' => 'node',
]);
$view_mode->save();
$entity_display = entity_get_display('node', 'article', 'token');
$entity_display = \Drupal::service('entity_display.repository')->getViewDisplay('node', 'article', 'token');
$entity_display->setComponent('test_field', [
'type' => 'text_trimmed',
'settings' => [
......
......@@ -17,7 +17,7 @@
*
* @var array
*/
public static $modules = ['path', 'token', 'token_module_test', 'system', 'user'];
public static $modules = ['path', 'token', 'token_module_test', 'system', 'user', 'path_alias'];
/**
* {@inheritdoc}
......@@ -25,9 +25,7 @@
protected function setUp() {
parent::setUp();
if (\Drupal::entityTypeManager()->hasDefinition('path_alias')) {
$this->installEntitySchema('path_alias');
}
$this->installEntitySchema('path_alias');
\Drupal::service('router.builder')->rebuild();
$this->installConfig(['system']);
}
......
......@@ -21,7 +21,7 @@ function testRandomTokens() {
$first_set = $this->assertTokens('random', [], $tokens, ['regex' => TRUE]);
$second_set = $this->assertTokens('random', [], $tokens, ['regex' => TRUE]);
foreach ($first_set as $token => $value) {
$this->assertNotIdentical($first_set[$token], $second_set[$token]);
$this->assertNotSame($first_set[$token], $second_set[$token]);
}
}
......
type: module
name: Token
description: Provides a user interface for the Token API and some missing core tokens.
core_version_requirement: ^8.7.7 || ^9
core_version_requirement: ^8.8 || ^9
# Information added by Drupal.org packaging script on 2019-12-30
version: '8.x-1.6'
# Information added by Drupal.org packaging script on 2020-04-26
version: '8.x-1.7'
project: 'token'
datestamp: 1577708590
datestamp: 1587893591
......@@ -673,6 +673,7 @@ function token_entity_base_field_info(EntityTypeInterface $entity_type) {
->setDescription(t('Computed menu link for the node (only available during node saving).'))
->setRevisionable(TRUE)
->setSetting('target_type', 'menu_link_content')
->setClass('\Drupal\token\MenuLinkFieldItemList')
->setTranslatable(TRUE)
->setInternal(TRUE)
->setDisplayOptions('view', [
......@@ -701,12 +702,6 @@ function token_form_node_form_alter(&$form, FormStateInterface $form_state) {
if (!\Drupal::moduleHandler()->moduleExists('menu_ui')) {
return;
}
/** @var \Drupal\node\NodeForm $form_object */
if (!\Drupal::currentUser()->hasPermission('administer menu')) {
// We're only interested in when the node is unsaved and the editor has
// permission to create new menu links.
return;
}
$form['#entity_builders'][] = 'token_node_menu_link_submit';
}
......
......@@ -791,7 +791,7 @@ function token_tokens($type, array $tokens, array $data = [], array $options = [
if ($arg_tokens = \Drupal::token()->findWithPrefix($tokens, 'arg')) {
$path = ltrim(\Drupal::service('path.current')->getPath(), '/');
// Make sure its a system path.
$path = \Drupal::service('path.alias_manager')->getPathByAlias($path);
$path = \Drupal::service('path_alias.manager')->getPathByAlias($path);
foreach ($arg_tokens as $name => $original) {
$parts = explode('/', $path);
if (is_numeric($name) && isset($parts[$name])) {
......@@ -848,13 +848,13 @@ function token_tokens($type, array $tokens, array $data = [], array $options = [
foreach ($tokens as $name => $original) {
switch ($name) {
case 'path':
$value = !($url->getOption('alias')) ? \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode) : $path;
$value = !($url->getOption('alias')) ? \Drupal::service('path_alias.manager')->getAliasByPath($path, $langcode) : $path;
$replacements[$original] = $value;
break;
case 'alias':
// @deprecated
$alias = \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode);
$alias = \Drupal::service('path_alias.manager')->getAliasByPath($path, $langcode);
$replacements[$original] = $alias;
break;
......@@ -876,7 +876,7 @@ function token_tokens($type, array $tokens, array $data = [], array $options = [
break;
case 'args':
$value = !($url->getOption('alias')) ? \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode) : $path;
$value = !($url->getOption('alias')) ? \Drupal::service('path_alias.manager')->getAliasByPath($path, $langcode) : $path;
$replacements[$original] = token_render_array(explode('/', $value), $options);
break;
}
......@@ -884,7 +884,7 @@ function token_tokens($type, array $tokens, array $data = [], array $options = [
// [url:args:*] chained tokens.
if ($arg_tokens = \Drupal::token()->findWithPrefix($tokens, 'args')) {
$value = !($url->getOption('alias')) ? \Drupal::service('path.alias_manager')->getAliasByPath($path, $langcode) : $path;
$value = !($url->getOption('alias')) ? \Drupal::service('path_alias.manager')->getAliasByPath($path, $langcode) : $path;
$replacements += \Drupal::token()->generate('array', $arg_tokens, ['array' => explode('/', ltrim($value, '/'))], $options, $bubbleable_metadata);
}
......@@ -1024,7 +1024,7 @@ function token_tokens($type, array $tokens, array $data = [], array $options = [
$algos = hash_algos();
foreach ($hash_tokens as $name => $original) {
if (in_array($name, $algos)) {
$replacements[$original] = hash($name, Crypt::randomBytes(55));
$replacements[$original] = hash($name, random_bytes(55));
}
}
}
......@@ -1630,7 +1630,7 @@ function field_tokens($type, $tokens, array $data = [], array $options = [], Bub
$field_output = $entity->$field_name->view($display_options);
// If we are displaying all field items we need this #pre_render
// callback.
$field_output['#pre_render'][] = 'token_pre_render_field_token';
$field_output['#pre_render'][] = '\Drupal\token\TokenFieldRender::preRender';
}
$field_output['#token_options'] = $options;
$replacements[$original] = \Drupal::service('renderer')->renderPlain($field_output);
......@@ -1773,28 +1773,3 @@ function field_tokens($type, $tokens, array $data = [], array $options = [], Bub
}
return $replacements;
}
/**
* Pre-render callback for field output used with tokens.
*/
function token_pre_render_field_token($elements) {
// Remove the field theme hook, attachments, and JavaScript states.
unset($elements['#theme']);
unset($elements['#states']);
unset($elements['#attached']);
// Prevent multi-value fields from appearing smooshed together by appending
// a join suffix to all but the last value.
$deltas = Element::getVisibleChildren($elements);
$count = count($deltas);
if ($count > 1) {
$join = isset($elements['#token_options']['join']) ? $elements['#token_options']['join'] : ", ";
foreach ($deltas as $index => $delta) {
// Do not add a suffix to the last item.
if ($index < ($count - 1)) {
$elements[$delta] += ['#suffix' => $join];
}
}
}
return $elements;
}
......@@ -1252,6 +1252,75 @@
"source": "https://git.drupalcode.org/project/csv_serialization"
}
},
{
"name": "drupal/custom_breadcrumbs",
"version": "1.0.0-alpha1",
"version_normalized": "1.0.0.0-alpha1",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/custom_breadcrumbs.git",
"reference": "1.0.0-alpha1"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/custom_breadcrumbs-1.0.0-alpha1.zip",
"reference": "1.0.0-alpha1",
"shasum": "1a89f33be922e687662ae47d9a9b7c41e995139f"
},
"require": {
"drupal/core": "^8 || ^9",
"drupal/token": "^1.0"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "1.0.0-alpha1",
"datestamp": "1594887609",
"security-coverage": {
"status": "not-covered",
"message": "Project has not opted into security advisory coverage!"
}
}
},
"installation-source": "dist",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "Szczepan Musial (lamp5)",
"homepage": "https://www.drupal.org/u/lamp5",
"role": "Maintainer"
},
{
"name": "Contributors",
"homepage": "https://www.drupal.org/node/98576/committers",
"role": "Contributors"
},
{
"name": "colan",
"homepage": "https://www.drupal.org/user/58704"
},
{
"name": "lamp5",
"homepage": "https://www.drupal.org/user/2870321"
},
{
"name": "thePanz",
"homepage": "https://www.drupal.org/user/58689"
}
],
"description": "Custom breadcrumbs helps the user to create and manage breadcrumbs menu on all content entity pages and other like views, page manager, controllers.",
"homepage": "https://www.drupal.org/project/custom_breadcrumbs",
"keywords": [
"Drupal"
],
"support": {
"source": "http://cgit.drupalcode.org/custom_breadcrumbs",
"issues": "https://www.drupal.org/project/issues/custom_breadcrumbs"
}
},
{
"name": "drupal/easy_breadcrumb",
"version": "1.13.0",
......@@ -1333,6 +1402,77 @@
"issues": "https://www.drupal.org/project/issues/easy_breadcrumb"
}
},
{
"name": "drupal/token",
"version": "1.7.0",
"version_normalized": "1.7.0.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/token.git",
"reference": "8.x-1.7"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/token-8.x-1.7.zip",
"reference": "8.x-1.7",
"shasum": "c7e3a3757282e4c94e3c1fff08d01e22155cb853"
},
"require": {
"drupal/core": "^8.8 || ^9"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "8.x-1.7",
"datestamp": "1589314266",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
},
"drush": {
"services": {
"drush.services.yml": "^9 || ^10"
}
}
},
"installation-source": "dist",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "Berdir",
"homepage": "https://www.drupal.org/user/214652"
},
{
"name": "Dave Reid",
"homepage": "https://www.drupal.org/user/53892"
},
{
"name": "eaton",
"homepage": "https://www.drupal.org/user/16496"
},
{
"name": "fago",
"homepage": "https://www.drupal.org/user/16747"
},
{
"name": "greggles",
"homepage": "https://www.drupal.org/user/36762"
},
{
"name": "mikeryan",
"homepage": "https://www.drupal.org/user/4420"
}
],
"description": "Provides a user interface for the Token API, some missing core tokens.",
"homepage": "https://www.drupal.org/project/token",
"support": {
"source": "https://git.drupalcode.org/project/token"
}
},
{
"name": "drupal/views_data_export",
"version": "1.0.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment