I have a bit of a pickle. I have custom content on user pages, and i need to be able to display some nodes (news posts etc) based on the authors account info. Although these examples are not exactly my situation, they are essentially the same thing. (changed so they make sense without knowing my full scope)

Query:
"Display all nodes where the _author_'s last name is X"

Hypothetical result:
Newspost A, by Author David Grey
Newspost B, by Author David Grey
Newspost C, by Author John Grey
Newspost D, by Author Sally Grey
Newspost E, by Author John Grey

Query:
"Display all nodes where the _author_'s home country is X"
Hypothetical result:
Newspost A, by Author David Grey from France
Newspost B, by Author David Grey from France
Newspost D, by Author Sally Grey from France

So.. how can this be done? The lastname, homecountry, and stuff, could really be anything. A profile field from profile.module, or a profilenode field from CCK & the profilenode.module. Anything that gets the job done.. thoughts?

Comments

iandickson’s picture

Nodeprofile and usernode , maybe Advanced Profile approaches might be useful here. Though how you solve the legacy issue....

Anyway, once the data is in discrete fields, VIEWS solves most problems :-)

Ian Dickson

Likal.com

Leefmc’s picture

Well, using profilenodes i was actually able to make "Views Arguments" see the users Last Name profile for example, but i had no luck in creating the advanced query of "Display nodes of ContentType where the author lastname is Grey".

Anyone have any ideas how this can be done?

notarealperson’s picture

I think you want to use Views Filters, not Arguments for this.

Leefmc’s picture

Well the point of using arguments was so that i could have a dynamically generated views list.

For example, if i used Views Filters instead of arguments, then i would have to have a separate views page for each "Display all nodes where the _author_'s last name is X" query.

In my actual useage case, its the difference between having 1 view, and having 20+ views.

Leefmc’s picture

So no thoughts on how this could be done?

siree’s picture

In case someone is still searching, this solves it: http://drupal.org/node/125990