Active
Project:
Advanced Forum
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2012 at 10:21 UTC
Updated:
10 Mar 2012 at 10:22 UTC
I've added two variables to comment-wrapper template to make it possible to jump to parent and/or any forum from the node page. That's a useful tool for any forum so some developers will probably welcome these additions.
$this_forum is a formated link to the parent forum current node is part of.
$forum_jump is the same jump menu that we've added before to the forum pages and it won't work without those changes.
theme.inc
function advanced_forum_preprocess_comment_wrapper(&$variables) {
...
// add these variables for forum nodes only
if ($variables['node']->type == 'forum') {
$variables['forum_jump'] = advanced_forum_forum_jump($variables['node']->forum_tid);
$variables['this_forum'] = l($variables['node']->taxonomy[$variables['node']->forum_tid]->name, 'forum/'.$variables['node']->forum_tid);
}
...
}
advanced-forum.naked.comment-wrapper.tpl
<?php if (!empty($forum_jump) || !empty($this_forum)): ?>
<div class="forum-jump-tools"><span class="this-forum"><?php print $this_forum; ?></span>
<span class="forum-jump"><?php print $forum_jump; ?></span></div>
<?php endif; ?>