3
votes
Accepted
How to delete the existing alias in drupal 9 / 10
Delete path alias: Drupal(8/9/10)
$path_alias_manager = \Drupal::entityTypeManager()->getStorage('path_alias');
// Load path alias by path
$alias_objects = $path_alias_manager->loadByProperties([...
1
vote
How do I parse a path alias?
// Retrieve an array that contains the path pieces.
$path_args = arg();
// Check if the current page is the page you're looking for.
if ($path_args[0] == 'about-us') {
// Your code.
}
1
vote
Accepted
How can I confirm a path is internal?
You should not check for internal. An url like internal:/robots.txt is internal, but it is no route and has no route parameters.
So before you do Url::getRouteParameters() you should check for Url::...
1
vote
Accepted
How to make it so theme function isn't used when editing a node with layout builder
More general for the block, if you want to make sure the theme function is only used when viewing the node and not in other node routes like editing, then check the route name first:
function ...
1
vote
Accepted
path alias OK for default language, but no alias for others
The old node probably has an alias with the language code UND (-not specified-). You can add one in the alias table
www.example.com/admin/config/search/path
but not in the node edit form. See https://...
1
vote
Bulk update for unchecked "Generate automatic URL alias"
In my case (for Drupal10 ) bulk update was not generating aliases due to the fact that all the nodes (when you edit a node) had unchecked the checkbox "generate automatic alias". I have ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
path-aliases × 8427 × 244
8 × 147
views × 125
taxonomy-terms × 90
nodes × 77
uri × 75
tokens × 55
i18n-l10n × 54
redirection × 43
6 × 38
routes × 36
entities × 26
users × 19
hooks × 18
theming × 17
navigation × 17
9 × 12
database × 11
forms × 9
commerce × 9
files × 9
migrations × 9
organic-groups × 8
importing-exporting × 8