views:

147

answers:

2

Hi,

Please consider helping a Drupal noob who is in danger of tearing out what hair I have remaining.

I have a view that I want to add an argument to so that it only displays the details of the specified product. Since I'm using URL aliasing the argument is in the form of shop/product1, shop/product2 etc. However, when I go to add an argument node path (which is what I have set to shop/product1 etc is not listed) the only I could use is Node: Nid but that doesn't work because my argument is not a node id but a path alias.

The workaround I've been using is to create a CCK field to store my node path and then create an argument using the CCK field. Is this the only option?

Regards,

Sean

+1  A: 

One way to do this would be to create a custom module and define your own callback which would then work out the NID from the path and pass that as an argument to the view using views_embed_view.

There are some contrib modules which allow you to filter by PHP code which would probably do as well.

Jeremy French
+1  A: 

I believe you can still use NID as the argument, as that is what's in the actual path even though you are displaying an alias in the address bar.

Nicholai

related questions