I can't believe I haven't found this feature yet, so if I've missed it, please tell me where to look.
I currently have a view that displays a block on every page of my site. if I'm on a category page like so: mysite.com/taxonomyterm I would like the block to show me only items relevant to that taxonomy term, i.e. accept that term as an argument.
Jen
Comments
Comment #1
nicholasthompsonHave you read through this?
http://drupal.org/node/70145
Comment #2
catchYep, it's possible with both argument handling code, and by using mini-panels (part of Panels2).
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
alexanderpas commentedI'm re-opening and seconding this request, as PHP code or using mini-panels should not be the only way to get arguments to blocks, as this is unnessecary complicated.
Comment #5
merlinofchaos commentedSigh.
Comment #6
merlinofchaos commentedFYI, I won't fixed this because it's not possible. Do you *honestly* think it'd work this way if it were possible?
Comment #7
Dave.Ingram commentedRe: #4.
What you have to understand is that the there is no linkage in code between a block and the page's URL. It's simply not possible to add this. Using the PHP code to grab the argument that you need is a very clean work around to this. You only have to learn a couple of small api functions to be able to get taxonomy terms, node IDs, or user IDs and use those as default arguments in the case that no argument exists (which it never will in a block.)
Perhaps one day if the Drupal block system is reworked, then there might be some kind of link between these two, but even then there are a whole lot of complexities to this and just providing the default argument yourself is a really really good way to tackle this problem.
Comment #8
jackbravo commentedWhat about letting the user choose an argument number from the URL for each contextual filter? I agree that PHP code has more flexibility and power, but that sounds like an easy solution IMO.
Comment #9
woop_light commentedThis worked without having to write any PHP. Thanks geeksandgod.
http://geeksandgod.com/tutorials/computers/cms/drupal/limit-views-create...
woop