12

I'm trying to pass an argument through a block created by a view.

The node is an ubercart product node. I have aliased the paths such as:

node/45 to products/[name]

In contextual filters, I've chosen the filter "Content: Nid"

In the Preview with contextual filters it works with the node id as it should. e.g. "45" but the view doesn't show on the page node/45.

I believe the alias may have caused the problem, but I thought Drupal was designed to have aliases converted to node id's.

2

2 Answers 2

12

In your contextual filter, under WHEN THE FILTER VALUE IS NOT AVAILABLE, choose Provide default value and select "Content ID from URL" under Type.

1
  • Thanks Adam. I figured out you need to do this for blocks.
    – chrisck
    Jul 17, 2011 at 4:04
1

You can also define an "Exception value" in the "Provide default value" option, like "all" which will bring you all the results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.