Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The forum topic list page as a 'New Topic' button and a 'Mark All Read' button.
A forum topic page only has a 'Post Reply' button.
How can I add a 'New Topic' button to the topic page?
I've searched the forums and the support list but could not find anything relating to my question. If I missed just point me in the right direction.
Thanks!
Comments
Comment #1
MichelleIn the node preprocess, check if the current user has access to post a new topic and then add a variable for the link. Edit the post template and print the variable.
Michelle
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedDo you mean to say that it is not possible to have a 'Post New Topic' button unless I hack the code?
I was hoping this behaviour was available by default somehow since it seems to intuitive to have a 'Post New Topic' button on those pages
Comment #3
MichelleYou don't need to hack the module. It can all be done via preprocess and theming.
No, it's not available by default. I don't know why it would be intuitive to have a button to post a new topic on the page when you just started reading a topic. If that's something you want for your site, though, it's all doable without any module changes.
Michelle
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks for clearing that up!
The reason it's a useful feature is quite simple. I'm reading a forum thread and realize I want to start a new discussion. So, I look for a button that says 'start a new topic' or something similar. Having to go back to the main Forum page to start a new topic is a bit troublesome.
Don't you sometimes want to start a new topic as you are reading someone else's topic?
Comment #5
MichelleOccasionally, if I want to do a spin off topic. I've never found it all that troublesome to go back to the forum page, though.
Michelle
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedTroublesome is perhaps a bit too strong a word but it *is* an extra step we are forcing on the user.
Having that functionality would make for a better user experience.
It's the same as your e-mail tool. When you read an email message on that very same page you have a 'create new message' button. The software doesn't force you to go back to the main menu or main home page in order to create a new email message.
Comment #8
webwriter CreditAttribution: webwriter commentedHi totsubo-
Did you work this out? I'm used to having a New Topic button on the topic page as well but am a little lost when it comes to preprocessing and checking for permissions. If you have more detailed instructions, I'd appreciate it!
Comment #10
Lalas CreditAttribution: Lalas commentedIf you want to add "New Topic" link near the "Reply/Edit/Delete" Buttons of the discussion add following code just below 'print $links' of advf-forum-post.tpl.php
This can be positioned anywhere in the template