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.

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.

  • Thanks Adam. I figured out you need to do this for blocks. – Chris Lai Jul 17 '11 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, privacy policy and cookie policy

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