I am somewhat familiar with PHP and MYSQL, but I'm still new to Drupal. How can I display a particular block for a particular forum? I know how to display a block for forum pages in general by using the options on the edit block page. But this displays the same block for every forum page, regardless of forum topic. Is there a PHP snippet out there that will let me display a particular block for a particular forum topic?

Comments

rlarivee’s picture

I found my own solution. The query string can be accessed within the block using the PHP code

echo $_GET['q'];

Once I have the string, it's just a matter of parsing it for the node number. Then lookup the forum number from term_node and use a case statement to switch the content from forum to forum.

sepeck’s picture

Feel free to write that up and add it to the php snippets section. I've seen others ask and not get it sorted out.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide