Jump to:
| Project: | Advanced Forum |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I've implemented a 'jump to forum' drop down list, much like what is described here: http://drupal.org/node/91924
Just add the code to your forum-display.tpl.php file. It would be great if something like this is added to a future version. Currently this code doesn't filter the drop down list based on anon/user, or if any forums are private (can't remember if this is even an option).
Also, the code will add any containers as a selectable option, looking something like this:
Jump to:
--forum
--forum
--container
--forum
You have to hack the code to filter out building an entry for each container, like this:if ($term->tid == 106) { continue; } // skip container
Just add the code right after the while ($term = db_fetch_object($vocabulary)) { statement.
Brad
Comments
#1
Thanks for the tip. This is actually something I wanted to add.
Michelle
#2
Listed on master to do list.
Michelle
#3
#4
Will revisit this in 2.x.
Michelle
#5
#6
Just a note that this will be added as soon as the jump menu code is added to CTools.
Michelle
#7
Postponing until after 2.0.
#8
Setting active. This isn't a difficult one and will likely get into 2.x.
Michelle
#9
This one will create (ctools) drop down menu for D7... probably will work on D6, too with minor changes.
advanced_forum.module:
/**
* Create a drop down list of forum hierarchy
*/
function advanced_forum_forum_jump($tid=0) {
global $user;
ctools_include('jump-menu');
$select = array();
$options = array();
$vid = variable_get('forum_nav_vocabulary', 0);
if ($tid > 0) {
$forum_tree = taxonomy_get_tree($vid);
foreach ($forum_tree as $forum) {
$select[url("forum/" . $forum->tid)] = str_repeat("-", $forum->depth) . $forum->name;
}
}
else {
// nothing
}
$options['choose'] = t("- Select a forum -");
// Create and return the jump menu.
$form = drupal_get_form('ctools_jump_menu', $select, $options);
return drupal_render($form);
}
theme.inc:
function advanced_forum_preprocess_views_view__advanced_forum_topic_list(&$variables) {...
$variables['forum_tools'] = advanced_forum_forum_tools($tid);
$variables['forum_jump'] = advanced_forum_forum_jump($tid);
...
}
advanced-forum.naked.topic-list-outer-view.tpl
<?php if (!empty($forum_tools)): ?><div class="forum-jump"><?php print $forum_jump; ?></div>
<?php endif; ?>
#10
I was going to make a view for this... Your way likely performs better but a view is more customizable by the end user. Dunno which is better for this... Just throwing that out there for now.
Michelle