Integrating recipes with other tools¶
Project Browser¶
Project Browser has strong integration with recipes. It supports recipes supplying additional custom tasks that users can perform from the Project Browser UI after the recipe is applied.
Custom tasks are simply links to Drupal routes or external URLs. You can define them in the extra
section of recipe.yml
. For example:
extra:
project_browser:
tasks:
# Example: Linking to an internal Drupal route. The route name, and
# any available route parameters, are defined in the relevant module's
# routing.yml file.
- text: 'Add an article'
route_name: node.add
route_parameters:
node_type: article
# Example: Linking to an external URL.
- text: 'Visit our partner'
uri: 'https://www.example.com'
# URL options can be supplied. This works for both internal and external URLs.
# The final URL of the task will be `https://www.example.com?some=value#anchor`.
options:
query:
some: 'value'
fragment: 'anchor'
"drupal/core": "^11.1.4"
in composer.json
) for this to work. The extra
section is not supported on older versions of Drupal, and will cause the website to crash. Your recipe does not need to depend on Project Browser; Project Browser will automatically display tasks defined by any recipe it knows about.
The tasks will be displayed in the order they are defined. Project Browser will also append a "Reapply" task to all recipes, displayed last: