Hooks provided by the Path module.

Path module provides automatic URL aliasing by using tokens in path patterns. Thus the simplest integration is just to provide tokens using hook_token_info() and hook_tokens().

If you wish to provide automatic path creation for custom paths provided by your module, there are a few steps involved.

1. hook_path_info() Provide information required by Path for the settings form as well as bulk generation. See the documentation for hook_path_info() for more details. 2. path_generate_entity_alias() At the appropriate time (usually when a new item is being created for which a generated alias is desired), call path_generate_entity_alias() with the appropriate parameters to generate the alias. Then save the alias with path_save_automatic_alias(). See the user, taxonomy, and node hook implementations for examples. 3. path_delete_all_by_source() At the appropriate time (usually when an item is being deleted), call path_delete_all_by_source() to remove any aliases that were created for the content being removed. See the documentation for path_delete_all_by_source() for more details.

There are other integration points with Path module, namely alter hooks that allow you to change the data used by Path at various points in the process. See the below hook documentation for details.

File

core/modules/path/path.api.php

Functions

Namesort ascending Description
hook_path_update Respond to a path being updated.
hook_path_punctuation_chars_alter Alter the list of punctuation characters used by Path module.
hook_path_pattern_alter Alter the pattern to be used before an alias is generated.
hook_path_is_alias_reserved Determine if a possible URL alias would conflict with any existing paths.
hook_path_insert Respond to a path being inserted.
hook_path_info Provide information about the way your module's aliases will be built.
hook_path_delete Respond to a path being deleted.
hook_path_alias_alter Alter generated aliases before saving.