Skip to content

Instantly share code, notes, and snippets.

@eneko
Created November 30, 2013 03:25
Show Gist options
  • Save eneko/7715002 to your computer and use it in GitHub Desktop.
Save eneko/7715002 to your computer and use it in GitHub Desktop.
Generate aliases for a taxonomy (Drupal 6)
module_load_include('inc', 'path', 'path');
module_load_include('inc', 'pathauto', 'pathauto');
$terms = taxonomy_get_tree(1);
foreach($terms as $term) {
$cleaned = pathauto_cleanstring($term->name);
path_set_alias("taxonomy/term/{$term->tid}", "categorias/$cleaned");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment