I want to embed a view which should display a list of nodes.
The author id of those nodes should be the id I pass to the function views_embed_view.
In other words; What I want is the view to take my user id parameter and return all nodes whos author id matches that parameter.
First problem is that I don't know the syntax of passing a parameter as argument for the view.
Something like this maybe?
- views_embed_view("nameOfMyView", $display_id="default", $idValue)
- views_embed_view("nameOfMyView", $display_id="default", $someRandomName=$idValue)
After that, how can I return a list of nodes by author id when I can't find any Node:author argument?
Should it be there?
Someone knows how to do that in Drupal 6 views 2?
Comments
Comment #1
Mattias Holmqvist commentedOk, the syntax for passing ONE arguments is simply:
views_embed_view("nameOfMyView", $display_id="default", $parameterValue)
I tested with node.id and it works. that node is now embedded.
But I want to choose "where node.author.id" = parameterValue.
Anyone knows why node.author.id is missing in the arguments I can choose from?
Comment #2
vm commentedmoved out of core queue to views queue
Comment #3
merlinofchaos commentedJust pass the arguments as the 3rd and later parameters to views_embed_view.
The argument "Node: author id" is now just "User: ID" -- this change was made because Views is no longer node-centric, and calling a user an author when not listing nodes wouldn't make much sense.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.