i've just moved from mdpro (+mdforum - phpbb2 fork) to drupal... and my users are moaning about the forums of course. I am reading lots of theming docs now, but for now i can only share one small hack...

Drupal puts previous and next topic links just in #content of node... my users pointed out that it looks ugly, and i agreed... what can i do about it? I managed to do it without modyfying core files, but maybe there is some other way?

my hack is

1) in node-forum.tpl.php add just above first div new div that looks like

<div id="forumnextprevlinks">
  	<?php print theme('forum_topic_navigation', $node); ?>  
</div>

2) in your theme css add

#content .forum-topic-navigation  
{
 display:none;
}

#forumnextprevlinks .forum-topic-navigation 
{
display:block;
}

With this the navigation for next/prev topic disappears from below the first post and appears on the top, just below topic name.

I know it is only fooling the browser, but i dont see other way to do it right... anyone?

Comments

krzysiek@palikowski.vel.pl’s picture

i cant edit my own post... strange...

I know my site looks like s#@t , but here you can preview the result of this code :

http://basoofka.net/2007/node/1166

regards...

budda’s picture

I don't see any code in the node-forum.tpl.php :-

<div id="forumnextprevlinks">
<?php print theme('forum_topic_navigation', $node); ?>
</div>
krzysiek@palikowski.vel.pl’s picture

you must edit this file to add this code in place you want navigation links to appear, in my case it was just above first post , not in content... so you have to actually add thic quoted code to the template file.

and after you add this you will have 2 navigations - above and in content... next step is set display of the secondary (unwanted) navigation to none, as i described above

My whole node-forum.tpl.php file looks now like that:


<?php
  if (!_is_forum()) {
    include('node.tpl.php');
    return;
  }
  $curr_user = user_load(array('uid' => $userid));
  $sig = $curr_user->signature;
?>

//additional topics navigation starts here
<div id="forumnextprevlinks">
  	<?php print theme('forum_topic_navigation', $node); ?>  
</div>
//additional topics navigation ends here

<div class="comment forum-comment comment-<?php print $row_class; print $comment->new ? ' comment-new forum-comment-new' : ''; ?>">
  <div class="comment-left">
    <div class="author-name"><?php print $name ?></div>
    <?php print $picture ?>

    <?php if (module_exist('flatforum')): ?>
      <span class="author-posts">
        <?php print t('Posty:') . ' ' . $posts; ?><br />
      </span>
      <span class="author-regdate">
        <?php print t('Rejestracja:') . ' ' . $joined; ?><br />
      </span>
    <?php endif ?>
  </div>

  <div class="comment-right">
    <div class="title"><?php print check_plain($comment->subject) ?></div>
    <?php if ($comment->new) : ?>
      <a id="new"></a>
      <span class="new"><?php print $new ?></span>
    <?php endif ?>
    <div class="content">
      <?php print $content ?>
      <br class="clear" />
      <div class="links"><?php print $submitted . ' ' . $links ?></div>
    </div>
  </div>
  
</div>
<br class="clear" />


ryivhnn’s picture

That's a much nicer way to do it. Might try that on the site I'm working on tomorrow when I can actually access the stupid server (it dies after 10pm which annoys me) and let you know then how it goes :P

I don't think it matters at this time whether it's "just fooling the browser" or whatever, as long as the users see what they want to see and it works how they expect it to work. What would be nice is being able to have the option of placing it at the top and/or the bottom or leaving it where it is :)

ps- i had to use div.content .forum-topic-navigation { display: none; } to get just the one in the forum post to disappear and leave the one on the top, in the unlikely event other people have the same weird issues I did with it :)

works at bekandloz | plays at technonaturalist

mortendk’s picture

just the QnD fix i was looking for, i had hoped it were possible to create somekind of fix through template.php but my knowledge of drupal isn't what it should be ;) -and well the end user cant se the difference so *cough* ...well hope its something that will be fixed in the 5.0 version -so we can get a cleaner approach to the templating

/morten.dk

michelle’s picture

I know this post is over a year old but I thought I'd add this for anyone that might come across it while searching:

function phptemplate_forum_topic_navigation($node){
  return ;
}

Michelle

--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.