Hello,
this is my first posting at the drupal.org-Forums and hope it is in the right topic :)
In most cases we use taxonomy_menu.module for the navigation through our content. We searched for a feature similar to phpWCMS [yes - I know - it's a hierarchical cms and don't know taxo's]: If you have only one node for a term specified the node and not the pager with the teaser should shown. If you have more as one node specified and published for the term the pager should used. We read many postings about this - but we don't find a really working solution for our set ups. We solved this problem with the following changes in taxonomy.menu:
Changes are inside the taxonomy_menu_page-function in taxonomy_menu.module - add the following lines:
...
if ($terms_to_list) {
foreach( ...
$term_list_output .= ...
}
/* additional code */
$nr_of_nodes = db_num_rows($nodes);
if ( $nr_of_nodes == 1 ) {
$node = db_fetch_object($nodes);
drupal_goto(url("node/".$node->nid));
}
/* end of additional code */
$rendered_nodes = taxonomy_render_nodes($nodes);
...
We use this code on many drupal sites at intranets and internet. A showcase at the internet is the german (work in progress) website http://segeln.veb-ts.de.
Can somebody check and comment our solution on other installations?
Thank you and with best regards!
Thomas
Comments
Patch with config option for this feature submited
The code above show also some parts from the patch http://drupal.org/node/16055 . I submited a patch for taxonomy_menu.module include the code above and the patch 16055. After patching you have more options to configure taxonomy_menu: enable/disabled the immediately redirect to the node and the parts from 16055.
The patch is at http://drupal.org/node/34325
Hope its a little help for some other people.
Thomas
---
Latest Drupal Project (work in progress):
http://segeln.veb-ts.de