Closed (fixed)
Project:
Drupal core
Version:
6.5
Component:
block.module
Priority:
Critical
Category:
Support request
Assigned:
Reporter:
Created:
13 Oct 2008 at 21:45 UTC
Updated:
14 Jul 2012 at 23:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
adpo commentedI tried with this code as well. (not working)
Comment #2
Anonymous (not verified) commentedYour code seems to work fine?? possibly the problem is in the code controlling the block?
Comment #3
Anonymous (not verified) commentedI tried the first block of code by the way - i like simpler solutions.
Comment #4
adpo commentedThank you for reply.
I`m just pasting this code into block visibility options:
Show block on specific pages:
Show if the following PHP code returns TRUE.
Where is the problem?
Comment #5
Anonymous (not verified) commentedI think you have probably forgotten to add
around the code. That will make it always return true just by virtue of the fact that something is there I think. I've used your code on my test site and its fine.Comment #6
adpo commentedHi bruceclothier,
Thank you for reply.
Which script have you been trying?
PS. I`m using Drupal 6.
Comment #7
Anonymous (not verified) commentedDrupal 6.4, using:
under the 'Show if the following PHP code returns TRUE' option of the block. I know this might be dumb, but have you checked all the basics? That you've selected the correct radio, that you've put the php open and close tags around the code, etc? Its this stuff that I easily forget to check. Your code does work fine though.
Bruce
Comment #8
adpo commentedI notice that when I type:
samplewebsite/taxonomy/term/1
I can see that block, but when I`m on certain page with term 1, the block is missing.
I check it on my second website.
PS. I attached print screen of my settings.
Comment #9
Anonymous (not verified) commentedYes, now that is all that you have asked it to do with that code (the one I tested). If you want it to show on more pages - i.e. all pages that have the term, you will have to add a bit of code. Just writing off the top of my head now I'd say something like this:
Comment #10
adpo commentedThank you. It is working. Can I buy you a beer?
Comment #11
Anonymous (not verified) commentedNo worries mate. Glad I could help.
Comment #12
Anonymous (not verified) commentedComment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #14
netentropy commentedThis code works great!
Can it be done with some sort of preg match so that it can catch all terms containing a certain sequence of letters?
for instance, it would place the block on terms: aloe vera, aloevera, aloe vera juice
Comment #15
rossdotparker commentedI hacked the code below together from a range of different sources (none of it is my own, but I did not record where it came from: if you want to claim it, please let me know!). It meets my 4 requirements in D6.8:
1) Show block for node with specific term ID
2) Show block for node with ancestors of term ID
3) Show block for listing page of specific term ID (e.g. taxonomy/term/id)
4) Show block for listing page of ancestor of specific term ID (e.g. taxonomy/term/idOfAncestor)
Comment #16
yesct commentedis this kind of what the context module does?
Comment #17
lizac commentedHi! Anyone who can modify this to appear on multiple terms and check their children pages? Any prompt response from you will be very much appreciated.
Comment #18
nooysters commentedI'm pretty new to this(php and drupal) but here's some code I came up with to show menu blocks on certain sections of my store. I have a root term for each section and this code finds the top parent of the current term. If anyone more experienced can help me make it better any help would be much appreciated.
Comment #19
IE938492 commentedYes. Was having trouble with this problem. The Context Module solved most of the issues without PHP. Excellent module.
http://drupal.org/project/context