diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-09-23 13:11:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-09-23 13:11:57 +0000 |
commit | 2de3276599665226466204034be661a58c7899fd (patch) | |
tree | 30a9836f54fe3b14b308e0c32999367e167d17f8 /modules/path/path.module | |
parent | 61740bd8ee133c3d0ea2543bccc4d00a62c9e3a0 (diff) | |
download | brdo-2de3276599665226466204034be661a58c7899fd.tar.gz brdo-2de3276599665226466204034be661a58c7899fd.tar.bz2 |
- Patch #29030 by Goba: updated the path module's documentation.
Diffstat (limited to 'modules/path/path.module')
-rw-r--r-- | modules/path/path.module | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/modules/path/path.module b/modules/path/path.module index fc051ee56..8f706de22 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -45,20 +45,7 @@ node/feed => index.rdf <ol><li><strong>create url aliases</strong> - Allows users to create aliases for nodes. Enabling this permission will display a path field to the user in any node form, allowing them to enter an alias for that node. They will be able to edit/delete the alias after it is created using the same form.</li><li><strong>administer url aliases</strong> - Allows users to access the alias administration interface. This interface displays all aliases and provides a way to create and modify them. This is also the location to build aliases for things other than nodes. For example, you can create an alias for a taxonomy URL or even re-map the admin path (although the original admin path will still be accessible since aliases do not cancel out original paths).</li></ol> <h3>Mass URL aliasing</h3> -<p>Drupal also comes with user defined mass URL aliasing capabilities. You might like to see completely different URLs used by Drupal, or even URLs translated to the visitors' native language, in which case this feature is handy. Only an administrator with access to the website source code can set up this kind of aliases. You can define a <code>conf_url_rewrite</code> function in your configuration file (eg. sites/default/settings.php), following this example:</p> -<pre> -function conf_url_rewrite(\$path, \$mode = 'incoming') { - if (\$mode == 'incoming') { // URL coming from a client - return preg_replace('!^display/(\\d+)\$!', 'node/\\1', \$path); - } - else { // URL going out to a client - \$aliased = preg_replace('!^node/(\\d+)\$!', 'display/\\1', \$path); - if (\$aliased != \$path) { return \$aliased; } - } -} -</pre> -<p>This function will shorten every <code>node/\$node_id</code> type of URL to <code>display/\$node_id</code>. Individual URL aliases defined on the browser interface of Drupal take precedence, so if you have the 'contact' page alias from the example above, then the <code>display/3</code> alias will not be effective when outgoing links are created. Incoming URLs however always work with the mass URL aliased variant. Only the 'incoming' and 'outgoing' modes are supposed to be supported by your <code>conf_url_rewrite</code> function.</p> -<p>You cannot only use this feature to shorten the URLs, or to translate them to you own language, but also to add completely new subURLs to an already existing module's URL space, or to compose a bunch of existing stuff together to a common URL space. You can create a <code>news</code> section for example aliasing nodes and taxonomy overview pages falling under a 'news' vocabulary, thus having <code>news/15</code> and <code>news/sections/3</code> instead of <code>node/15</code> and <code>taxonomy/term/3</code>. You need extensive knowledge of Drupal's inner workings and regular expressions though to make such advanced aliases.</p>"); +<p>Drupal also comes with user defined mass URL aliasing capabilities. You might like to see completely different URLs used by Drupal, or even URLs translated to the visitors' native language, in which case this feature is handy. You need to have a working PHP programming knowledge to make use of this feature however. Read on in the <a href="%mass-alias-doc">Drupal Handbook about mass url aliasing.</a></p>", array("%mass-alias-doc", "http://drupal.org/node/23708")); } } |