I'm using the Advanced Forum module and would like to configure my site so that the right sidebar is suppressed/eliminated whenever anyone views the forum index (foo.com/forum) or forum content.
I can get the sidebar to disappear for the forum index by entering its address in the blocks' "page specific visibility settings" area, but that obviously doesn't solve the problem for the user-created forum content.
The block settings allow me to control block visibility by user roles, but not content types. Is there a quick php snippet (I'm php illiterate; the webmonkey php lessons are on my to-do list) that can be plugged into the "page specific visibility settings" area to accomplish this or is this something that would be better suited for views.
Thanks for your advice.
Comments
forum/*
I don't use the Advanced Forum module myself but as long as all the user-created forum content has "foo.com/forum" in the URL then you should be able to suppress any right sidebar blocks by putting "forum/*" in the page specific visibility settings.
You can also create a new template that will be used for specific forum pages called "node-forum.tpl.php" and just disable the right sidebar completely.
I though the forum/* would
I though the forum/* would work, too, but the link for forum topics is coming up "foo/node/23" not "foo.com/forum/23"
In that case you may want to
In that case you may want to use the Pathauto module to rewrite the URLs for any forum content to replace "node" with "forum". Then "forum/*" should work fine.
block visibility settings may
block visibility settings may work, but it sounds to me like you want to hide the entire "sidebar" region. you can do this with code something like this in your theme...
first, in template.php :
then, in page.tpl.php :
this may not be the most efficient approach for the server, since i believe all of the sidebar content has to be generated by Drupal before being unset... so i'd assume that using Drupal's block visibility settings in addition to an approach like this would be smart, but maybe someone else can comment on that. anyway, hopefully you get the idea.
see these pages in the handbook:
http://drupal.org/node/190815
http://drupal.org/node/223430
Thanks
EDIT: ok, forget it - the code below took off sidebar on entire site
I used your code and everything is fine except for the forum listing and containers.
/forum/taxonomy/term works fine - hides region[sidebar]
/forum fails - still displays sidebar
/forum/taxonomy fails - still displays sidebar
I did find a fix but I dont know if its the correct way to use it.
Its the best I could come up with.
Now I just need to find out how to change the #content{} CSS width or add a new wider entry.
Find answers here
Find answers here http://drupal.org/node/448172
OK, I know this is an old
OK, I know this is an old topic but I had same problem and i came out with this solution using php for block visibility.
this is the code i used:
this code shows the block on every page but forum