Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Can we implement hook_admin_paths D7 hook (declare it in route definition for D8) in this module?
In our project we ran into issue where we are doing a lot of frontend optimization for the frontend and we don't want them to interfere with the backend/admin interface. So we are using path_is_admin()
often.
Plus token/tree is an admin path IMO.
Thoughts?
D8
in: token.routing.yml
(see 2224207)
token.tree:
path: '/token/tree'
defaults:
_controller: '\Drupal\token\Controller\TokenTreeController::outputTree'
options:
_admin_route: FALSE
requirements:
_csrf_token: 'TRUE'
D7
in: token.module
(see hook_admin_paths API doc)
/**
* Implements hook_admin_paths().
*/
function token_admin_paths() {
return array(
'token/tree' => TRUE,
);
}
Comments
Comment #2
gabriel.achille CreditAttribution: gabriel.achille as a volunteer commented