By luyendao on
Hi ! I know you can do this with forum nodes using flat forum, but has anybody themed the actual forum page, that which contains all the forum lists, threads and so forth?
Any examples of this having been done? Many thanks
Hi ! I know you can do this with forum nodes using flat forum, but has anybody themed the actual forum page, that which contains all the forum lists, threads and so forth?
Any examples of this having been done? Many thanks
Comments
Override theme functions
The forum list is generated by several theme functions.
theme_forum_display for the page
theme_forum_list for the actual forum list and
theme_forum_topic_list for the topic lists
Refer to the phptemplate docs to see how to override additional theme functions using template.php.
Use the code from the theme_forum_* functions as an example how to get your own output. You can find them in forum.module line 755, 834 and 889.
--
When your problem is solved, please post a follow-up to the thread you started.
Thank you Heine, just by
Thank you Heine, just by listing those functions, i somewhat understand how over-riding themes works now. Not being a programmer, it's taking me a bit longer to "get it"...but i will give it a go.
Example
I found some more time this night (note this is all quick and perhaps not the ideal way to do something):
You can do a lot with CSS alone. Sometimes you need to rearrange certain parts of the forum.
First of all, get yourself a phptemplate theme if you don't have it already.
Create or append to the_theme/template.php:
Now you can create the_theme/forum-list.tpl.php to keep it easy simply copy the code from theme_forum_list. You can play around with the builtin styles, perhaps do away with the tables, whatever you want, without hacking core!
--
When your problem is solved, please post a follow-up to the thread you started.
Ohhh, i see. I understood
Ohhh, i see. I understood intercepting drupal functions, but wasn't sure where you would get the variables and data from. It never occured to me to just copy and paste the source code. That feels so advanced ;-)
Thank you again, i hope this thread helps others. Sooner or later building a site, you get to the forums, and think, hmm, this isn't as easy as changing the way nodes look (with phptemplate).
Thanks again!
Thanks!
(Bookmarking for future reference) :)
does this work for 4.7?
I can't get it to work, wondering if 4.7 is supposed to be done differently.
Jen
=-=
May want to consider the flatforum.module for D 4.7.x see: http://drupal.org/project/flatforum, which should help you with the template.php and the forum.css
FlatForum won't theme the overview page
Yes, I have flatforum installed. It was designed to theme the forum topics, not the overview page. So unfortunately, I need to get this working too.
Jen
customizing headings
Hi,
I'm trying to customize the actual headings. So for instance instead of "Post new forum topic", I want it to say "Add new message". And instead of "Created" to say "Date Posted" and so on.
I tried inserting below code in forum_list.tpl.php. I'm either inserting in the wrong location or I'm definitely doing something wrong because nothing is happening.
if (user_access('create forum topics')) {
$output .= l(t('Add new message.'), "node/add/forum/$tid");
}
else if ($user->uid) {
$output .= t('You are not allowed to post a new forum topic.') ;
}
else {
$output .= t('Login to post a new forum topic.', array('%login' => url('user/login')));
}
Can you help? or direct me somewhere for answers?
I'm new to .php, so I really don't know what I'm doing.
Thank you so much in advance.
Tatyana
Interesting post,
Interesting post, subscribing, needing forum-theme changes also on http://www.trekking-world.com/forum
greetings,
Martijn
Old post
This is a very old post and most of it isn't applicable anymore. Flatforum is dead. If you have questions about theming your forum, you're better off starting a new topic with your questions. "Subscribing" to a post that has been dead for a long time won't get you new information.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
Thanks Michelle, sometimes
Thanks Michelle, sometimes somebody is triggered again, but you are right, Too old posts are dead...
Greetings,
Martijn