[drupal-devel] [feature] Path aliases - controlling outgoing alias
drupal-devel at drupal.org
Sun Jun 5 04:48:37 UTC 2005
Issue status update for http://drupal.org/node/24321
Category: feature requests
Assigned to: Anonymous
Reported by: mikeryan
Updated by: ramdak5000
Can I apply this to pathauto-4.5?
June 5, 2005 - 07:14 : mikeryan
Attachment: http://drupal.org/files/issues/alias_0.patch (6.63 KB)
Here's a patch to implement 2/3 of my previous suggestions .
1. A *status* column is added to the url_alias table. A 0 (zero) value
indicates an alias explicitly created by a user or administrator; a 1
(one) value indicates an alias created by an automated process. No core
code support is required here - aliases created by core methods (the
node form or url aliases settings) will default to 0. The pathauto
module (or any other module that wishes to automatically generate
aliases) will create them with a status of 1, and when updating aliases
will only delete/modify aliases with a status of 1, so that aliases
created explicitly by users are not blown away.
2. A *weight* column is added to the url_alias table. As path aliasing
exists now, multiple aliases may be created for a given path but there
is no control over which one is generated in the outgoing direction (as
in listings). This patch adds the support for editing weights for
aliases to the url aliases settings (and both *status* and *weight*
become optional arguments to path_set_alias()), and
drupal_lookup_path() is modified to pick the lowest weighted alias in
response to an 'alias' call (if there's a tie for lowest weight, it's
the same result as before, which is most likely lowest pid === first
I really wanted to implement a method for having aliases that produce a
301 (Move Permanently) response, particularly if you want to change the
alias for a page without abandoning any bookmarks/search engine links
that are already out there - but I started on it and realized it will
require more thought to integrate cleanly... It might just be easier to
do that using conf_url_rewrite()...
Thanks for your consideration...
More information about the drupal-devel