summaryrefslogtreecommitdiff
path: root/modules/path
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-08-07 19:45:54 +0000
committerDries Buytaert <dries@buytaert.net>2004-08-07 19:45:54 +0000
commitbdbc34c93be3cd400d576ce4925496fbc298020e (patch)
treec34f21774c3a5bc9898b197beed5e88d3bbecc65 /modules/path
parent6f024382e5579bb1fd27dcbca31ed2ff34aaebbd (diff)
downloadbrdo-bdbc34c93be3cd400d576ce4925496fbc298020e.tar.gz
brdo-bdbc34c93be3cd400d576ce4925496fbc298020e.tar.bz2
- Patch #6760 by JonBob: refactored the taxonomy module URLs to be nicer, improved the code/Doxygen comments.
As discussed before, the path "taxonomy/page/or/1,2" becomes "taxonomy/term/1+2" and the path "taxonomy/page/and/1,2" becomes "taxonomy/term/1,2". The most common case of listing nodes attached to a single term becomes simpler, since it doesn't require a meaningless "or" or "and". A depth of "0" is assumed, but a positive integer or "all" can be used. Feeds are available at "taxonomy/term/1+2/all/feed" and the like. This iteration of the patch also changes the structure of taxonomy_select_nodes(), since it was not following Drupal conventions. A handful of contrib modules call this function, and will need to be updated. Instead of passing in a $taxonomy object containing parameters for the function, the parameters are passed independently. This simplifies the code quite a bit. The queries were changed to only return node IDs for speed; all results from this function are passed through node_load() anyway, so the extra information returned was discarded. The AND query was also changed to avoid the strange trick and remove an extra query, at the expense of a table join per root term in the AND. This cleans up the code substantially while at the same time enabling the use of AND with a depth parameter. TODO: update contribution modules.
Diffstat (limited to 'modules/path')
-rw-r--r--modules/path/path.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/path/path.module b/modules/path/path.module
index 459533563..4ce7b0514 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -21,7 +21,7 @@ user/login => login
image/tid/16 => store
-taxonomy/page/or/7,19,20,21 => store/products/whirlygigs
+taxonomy/term/7+19+20+21 => store/products/whirlygigs
node/3 => contact
</pre>
@@ -53,7 +53,7 @@ function conf_url_rewrite(\$path, \$mode = 'incoming') {
}
</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/view/or/3</code>. You need extensive knowledge of Drupal's inner workings and regular expressions though to make such advanced aliases.</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>");
}
}
@@ -165,7 +165,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
*/
function path_form($edit = '') {
- $form .= form_textfield(t('Existing system path'), 'src', $edit['src'], 50, 64, t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/page/or/1,2.'));
+ $form .= form_textfield(t('Existing system path'), 'src', $edit['src'], 50, 64, t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'));
$form .= form_textfield(t('New path alias'), 'dst', $edit['dst'], 50, 64, t('Specify an alternative path by which this data can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'));
if ($edit['pid']) {