Hello,
I want to change forum node , but i counldn't find anything about it in phptemplate documentation.
Whould you please help me?
thanks

Comments

Dublin Drupaller’s picture

hiya Sinasalek,

Is it the full forum page layout you want to change..or just the layout of how posts look?

With phptemplate based themes, you should see a comment.tpl.php file, which controls how posts look inside a forum. But if you want to change the layout of the entire forum page layout, let me know as I've been looking at that recently.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sinasalek’s picture

Hi Dublin Drupaller and thanks for your reply
i already changed comment.tpl.php, and now i wanna change entire forum page layout to somthing better , like drupal forum page : http://drupal.org/forum

Best Regards

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

Dublin Drupaller’s picture

hi sinasalek,

I see what you mean.

The majority of the layout for that page you linked to is done using STYLE.CSS.

I would tend to suggest creating your own page-forum.tpl.php file as outlined at this handbook page -
Customising the full page layout and sections based on node type - which explains how you can do that.

That will give you more control over how your forum is displayed.

Also, I haven't used it, but there is a flatforum theme that I notice other Drupallers speak very highly of. That might offer another alternative for "skinning" your forum the way you want.

If you want to keep things simple and you are familiar with Style sheets and CSS, I recommend you try and use the style.css file that came with your theme to do it as much as possible. The Drupal.org theme is not available for download - which is correctly intended to keep Drupal.org unique - but I'm sure you could learn from how that forum link you posted was done using their stylesheet as a guide.

Hope that helps
Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sinasalek’s picture

hi again,
after i had a look at the useful links you sent (thanks), i think i should change my question . sorry for my mistake.
in fact i want to customize forum main layout : http://drupal.org/forum
below code is inside my "page.tpl.php", i find out that it's where i should include my new forum layout but there is two problem. 1.i don't know which variable can indicates forum page. 2.i don't know what are forum main page variables to making new forum main page.

<?php if ($tabs != ""): ?>
	<?php print $tabs ?>
<?php endif; ?>

best regards

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

Dublin Drupaller’s picture

the $node->type variable is the one you want...

for example:

<?php
if ($node->type == 'forum') {
  print "this is a forum page";
  }
?>

You can see how it is used to load a different layout at this link http://drupal.org/node/45944

Hope that helps. If that is too complicated for you, I suggest you use the FLATFORUM THEME. See my post above.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sinasalek’s picture

It's only work with forum nodes, not forum main page(the one that shows forum categories).i put 'print $node->type' right into 'page.tpl.php' but i didn't see anything except when i select a node.
please have a look at below screenshots....

a node page : http://www.tehlug.org/files/a%20page%20node.jpg
a forum node : http://www.tehlug.org/files/a%20forum%20node.jpg
forum main page : http://www.tehlug.org/files/forum.jpg

the third one is what i want, seems that it's not a node! so what is it?

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

Dublin Drupaller’s picture

hi sinasalek..

Apologies..that's what I thought you wanted to do..i.e. change a forum node using phptemplate..

try this:

Step 1: rename your page.tpl.php file to be called page-default.tpl.php

Step 2: copy the page-default.tpl.php file and name it page-forum.tpl.php

step 3: copy the following snippet into a text editor and save that file as page.tpl.php

Step 4: upload the three files to your active theme folder and edit the page-forum.tpl.php file to suit.

<?php
/**
* This snippet loads up different page-type.tpl.php layout
* files automatically. For use in a page.tpl.php file.
*
* This works with Drupal 4.5,  Drupal 4.6 and Drupal 4.7
*/

if (arg(0)=="forum") {/* check if the path is example.com/admin */
    include 'page-forum.tpl.php'; /*load a custom page-forum.tpl.php */
    return; }

/*u can insert more layout calls here before the call to page-default.tpl.php */

include 'page-default.tpl.php'; /*if none of the above applies, load the page-default.tpl.php */
    return; }
?>

Hope that helps..it uses the PATH to determine which layout file to use.

More details about this technique is at the following handbook page: http://drupal.org/node/46027

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

sinasalek’s picture

Hi, never mind and many thanks for your help, i tested it and worked fine.
another problem is i don't know what is forum layout variables. there is a variable in page.tpl.php called $content, but it's not useful because it gives me just forum generated HTML so i can't do any customization.
would you please tell me where can i find its variables? is there any sample?

Best Regards - Sina Salek

sina.salek.ws, Software Manager & Lead developer
Feel freedom with open source softwares

gurukripa’s picture

hope someone was able to get better forum looks..pls share

BradM’s picture

flatforum HEAD works with Drupal 5 and some themes.

http://drupal.org/node/95590

It's a good starting place. :)