By scarer on
Is there a way to move the next and previous forum topic navigation to the top of the node rather than the bottom?
Is there a way to move the next and previous forum topic navigation to the top of the node rather than the bottom?
Comments
found this post
http://drupal.org/node/85135
.
Just an FYI, that's for 5.x. I haven't tried moving it in 6.x, just getting rid of it completely, but doing that is different than in 5.x
Michelle
solution
Hi!
The theme developer in the devel module is a huge help with this.
Basically what's happening is that the forum topic navigation is printing with the body of the node. You can change the order by not printing the default node body and instead separating the elements.
All you need to do is create a file called node-forum.tpl.php and then paste the following into the file:
Hope that helps :)
what about printing the nav links before the title?
thanks x_ash_x
however i am still to find out how to print the forumnextprevlinks before the title of the page. any suggestions? might have a play with the code above.
.
I was in the mood for a change of pace, so just added this to Advanced Forum. Here's an adapted version that you can put in your own site module:
What this does is takes the navigation stuff out of the content variable so it doesn't get stuck in with the content. It also assigns it to a new variable outside of the content array. This new variable is then accessable to any preprocess / template where the $node object is available as $node->forum_topic_navigation. That should let you move it wherever you want.
Michelle
when i tried the dev version of advanced forum i get a blank pag
when i tried the dev version of advanced forum i get a blank page. i wanted to see this in action. i don't really want to change the core forum module.
i tried adding the code:
to the bottom of the advanced_forum.module file but it doesn't seem to like it.
.
I don't know why you'd be getting a WSOD... It's working fine AFAIK. At any rate, I wasn't suggesting hacking AF or core forum. I was suggesting you adapt the function I pasted before and put it in your own module.
Michelle
it seems to be when i try to run the update script
i was just using the core forum module so i don't have module to hack unfortunately.
.
You should have a site specific module to put snippets like this in. You can't do it without a module because themes can't use hook_nodeapi.
What update script are you talking about?
Michelle
still can't seem to get it to work
i created a new module called forum_navigation and pasted this code in the forum_navigation.module file:
i enabled the module and it still doesn't seem to work.
the update script - the drupal update.php file that you are prompted to run when you install the dev version of advanced_forum
.
Doesn't seem to work in what way? Does it give you errors? Are you not getting the new $node->forum_topic_navigation variable?
As for update.php... that's very strange. There shouldn't be any updates to run for AF if you're installing 2.x for the first time.
Michelle
haven't tried uninstalling and then re-installing
i haven't tried uninstalling advanced forum and then re-installing. this error occurred when i replaced the module files with the dev files.
yeah it doesn't semm to be rendering the $node->forum_topic_navigation variable - i tried putting it in the node-forum.tpl.php and the page.tpl.php for my module and it doesn't show.
.
Wait, replaced _what_ module files? You said you were only using core forum, so I assume you were installing AF for the first time. If you mean you just replaced the 1.x files with the 2.x files and tried to update, yeah, you're likely to get a mess. The upgrade process isn't quite that simple.
I don't know why the variable wouldn't be getting set for you... Very strange. It's working fine in AF now. If you're running AF, make sure you have the option to turn on the navigation set. Other than that, I can't think of anything, sorry.
Michelle
it's ok i'll have a look at your suggestions
thanks for all your help. and if i find a fix or what the problem is i'll post it up ;)
i ended up putting this code in
i ended up putting this code in the node-forum.tpl.php:
still not getting the next previous links to forum topics before the page title though.
.
I don't know what to tell you anymore... The way I did it works. I put it at the bottom of the page like vB does, but you could put it anywhere you have access to the $node object. The code you have there doesn't make a lot of sense... It looks like you're putting the code for a comment in your node template. Keep in mind that the page title will print from page.tpl.php if there is a single node on the page.
That's all the more I can do here.
Michelle