By techguy10 on
I want to make it so certain blocks only appear on specific content types (for example: "page") is there an easy way to do this with a module? I've been searching so far the only solution I see is using php code in the block, I've been playing around with the views module to see if it can do this but it seems it can't. Any suggestions are appreciated
Comments
No module that I know of,
No module that I know of, people generally use PHP to control the visibility of blocks based on content type.
This is what I use
I use this in my code
I tried Site building › Blocks and then "Show if the following PHP code returns TRUE (PHP-mode, experts only)." option - I entered the following:
But it doesn't seem to work. Anyone know why?
-----------------------------------------
Finally, I CMS that I Like!
http://www.CompShack.com
$node is not defined in a
$node is not defined in a block, you need something like
Figure it out!
nevets - your code was missing the "return true" for the block to display :) - here is a working code - tested and works great.
-----------------------------------------
Finally, I CMS that I Like!
http://www.CompShack.com
See what happens when you
See what happens when you copy and paste and only answer the question asked :)
good job
good job
mohd nashaat
abu3abdalla@gmail.com
mohdnashaat@msn.com
eng_abu3abdalla@skype
www.tajahdev.com