By pancid on
Hello,
I'm new to drupal and face the following problem:
I create a standard node, with the following url: /drupal/?q=node/52
Now I use the views module to create a "page view", which shall list all the nodes who have a reference field, which is referencing to node 52 (or any other node given in the url field), inside.
These are the settings of the views:
Field: Node title
Filter: Node Type = houses
Argument Type: Node Reference: country (field_country)
So I thought because i include the argument field, the views would automatically get parse the node id from the url. However, it's not doing that...
I'm looking forward to your suggestions!
Thanks a lot.
Comments
...
(You should tell us what version of Drupal you're using.)
sorry...
sorry...
im using drupal 5.7 plus views 5.x.16
I found another post, very similar to mine. only the language was more sophisticated... the guys asked "How can an embedded view take arguments from the url?" http://drupal.org/node/196625
btw. the view query works perfectly fine... only when I include the view in another node by using the module "viewfield", it doesn't work. in the post up there, people found that arguments from the url can't be used by an embedded view.
No one came up with a decen solution there.... do any of you guys know how to solve that problem? or maybe some other ways of doing it?
Thanks!
...
That's right. But 'viewfield' knows how to pass arguments to the view. You could ask it to pass %nid or [nid] or whatever.
(Alternatively, type "$args[0] = 52;" in your view's 'argument handling code'. If that works, change it to "$args[0] = arg(1);" However, since this technique reads the NID form the URL, it won't work when e.g. you're showing a list of nodes because then the URL isn't of the form 'node/#'.)
Don't know about the guys. We're a bunch of individuals here, not an individual bunch ;-)
wow
Thanks so much! It worked! Im so happy, already worried i'd have to reconsider the whole structure of my site.
Individuals are always needed ; )
Thanks again!