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

Mattias Holmqvist’s picture

Ok, 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?

vm’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 6.2 » 6.x-2.x-dev
Component: other » Miscellaneous

moved out of core queue to views queue

merlinofchaos’s picture

Status: Active » Fixed

Just 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.