Over the last weeks I have been doing a lot of experimenting
with the new views module. I have actually been able to do some
neat things with the headers like add an "A | B | C ..." to the
heading to allow you to select on the nodes that begin with
letter x, and allow a user to drill down on a list of terms.
But my latest has been I was able to turn a taxonomy into a
set of tabs with only a single view. It actually works really
well and is very good. Here is the code that does it.
[?php
$views =& $GLOBALS['current_view'];
$args = $views->args;
$primary = taxonomy_get_tree(2, 0, -1, 1);
if ($args[0]) {
if (!($parents = taxonomy_get_parents($args[0]))) {
$parents[$args[0]] = taxonomy_get_term($args[0]);
}
$breadcrumbs = drupal_get_breadcrumb();
array_pop($breadcrumbs);
$breadcrumbs[] = l($items['items'][menu_get_active_item()]['title'], $view->url);
foreach ($parents as $term) {
$breadcrumbs[] = l($term->name, "{$view->url}/{$term->tid}");
}
drupal_set_breadcrumb($breadcrumbs);
}
if ($primary) {
echo '
It is not a real set of tabs like what the Drupal menu system creates, but it is the same <HTML> so it should always look the same as your standard tabs.
Also you need the argument handling code which will make sure that a second level term is always used.
[?php
if (!$args || !$args[0]) {
$primary = taxonomy_get_tree(2, 0, -1, 1);
$term = array_shift($primary);
$args = array($term->tid);
}
return $args;
?]
Please consider submitting
Basically by published this
You might be able to skip a
Thanks.
example
a demo url would be real nice. sounds cool.
-moshe
demo
I have done this a yet to be released client site, So I have set up a demo here.
Goto /myprojects_menu
Wow, that's pretty freakin'
Thanks, I really like the
You could probably put the