On my site, we have "Author Profiles" (nodes with CCK fields for Name, Research interests, User ID, etc...) as well as Biblio publications. I would like to be able to generate a Views block to place on these Profile pages that lists all of the corresponding author's publications. Since I have the user id in the Profile node, I can pass that as an argument to Views and theoretically could match it up with Biblio nodes (since Biblio now has the "Drupal User ID" field on the edit author page). However, in practice this is currently impossible because the "Drupal User ID" field is not exposed in Views as a filter choice. The nearest thing, Biblio Contributors, is a select list and doesn't appear to take arguments.

Is there another way to do this currently, or can this functionality be added to the next release? Thanks!

Comments

rjerome’s picture

No I don't think this is currently possible, but I think it would be fairly simple to implement. Actually, on the weekend I revisited the Views code a bit and hope to add some additional functionality in terms of sorting and filtering very soon. I will keep your request in mind and make sure it's one of the first to hit the street.

Ron.

Dane Powell’s picture

Thanks a lot for the quick response Ron, I look forward to it. Let me know if I can help.

danieleboyo’s picture

subscribing

This module is awesome so far! keep it up!

daniele - Evolving Web

rjerome’s picture

I just released 6.x-1.5 which contains a much more complete Views integration. Give it a try and let me know how it works..

Ron.

Dane Powell’s picture

Status: Active » Fixed

Awesome, this is a great step forward. I still can't figure out how to do what I want, but I think that's due to a limitation with Views and not Biblio (I need to figure out how to pass arguments from each Member Profile to a View that will generate a list of all publication by that member, and then display that View inline on the Member Profile)

rjerome’s picture

I don't profess to be a Views expert either, but I must say the this exercise has made me a believer, and I thinking seriously about doing all the biblio pages using Views.

What about making your entire member profile page with views?

Dane Powell’s picture

Ooh... what a neat idea. For now I think the views_attach module will get the job done, and it'll be a good first step in that direction for me.

Dane Powell’s picture

Status: Fixed » Active

Actually, I think I might need some more help with this - I'm not sure if it's a problem with Biblio, or if I just don't understand how to use Views.

I created a display of type "Node Content". The default argument passed is the user_id of interest (this comes from a CCK field on the Member Profile). I need to filter the view based on Biblio: Drupal User ID using the user_id argument. Any idea how to do this? I am completely stumped and don't really understand how arguments and filters can interact. :)

Dane Powell’s picture

I've taken a little closer look at it, and I'm thinking there's a bug with Views_attach. Can you just confirm this for me to make sure I'm not doing something wrong- if I pass a user_id (the number, not the user name) as an argument for Biblio: Drupal User ID, only Biblio publications with that author listed on them should be returned, correct?

rjerome’s picture

That is correct, if you pass the Durpal UserID as a integer value to the argument handler, then only publications which have this UID as an author will be displayed. (I just tried it, and it works for me :-)

Ron.

Dane Powell’s picture

Status: Active » Fixed

Beautiful! It did turn out to be a bug in views_attach #485832: Token data not passed to argument. With that nailed everything is working great. Thanks for your help.

ublanke’s picture

Hey guys,

I'm still struggling getting views to work properly with biblio.
I started to experiment with a simple views page (not the views attachment) and wanted to set a hardcoded user id of biblio to test it.

When selecting biblio: drupal user id as filter, I can't set any value (apparently it automatically chooses the logged-on user).
Can anyone give me a short hint on how to combine views and biblio?

Sorry, just started drupal and im not very proficient,

cheers,
ulf

p.s.: reason to use views instead of standard biblio tabs, is that the tab doesnt show when using profile node (works just for the http://website/user/8). If there is a way to get the tabs into the profile nodes i'd be happy about that too :).

Dane Powell’s picture

I suspect that you need to learn the same thing that I did in order to make this work: arguments are basically filters that accept an nid or uid from the URL. In other words, do exactly what you're doing now, but do it with arguments instead of filters. To test (or "hardcode" a uid) I think you can provide a default argument. Let me know if you still need help. Remember that in order for this to work you need to link authors to their Drupal user ids in biblio.

ublanke’s picture

Many thanks about the argument hint. It works now.

Dane Powell’s picture

No problem, glad to hear it works for you :)

Status: Fixed » Closed (fixed)

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

aboros’s picture

Title: Enhancing Views compatibility » Can I use 'Biblio: Drupal UserID' with a relationship?

hi,

i am trying to do the same. i have 'profile' node type created with 'content profile' module. my users are associated with biblio authors on their user account page. i am going to create a block (or a tab) which appears on such 'profile node' pages and shows the corresponding publications.

i can easily create a view for this, however the argument 'Biblio: Drupal UserID' won't use relationships. if i add a relationship 'node: content profile' and then i set up the 'biblio: drupal userID' argument to use this relationship, provide default argument, user id from url, also look for a node id and use the author of the node, the query has no results at all.

i have a user with id 1943, his 'content profile' node is nid 69.
if i pass 69 as the argument, the query will look like this:

SELECT node.nid AS nid, node.title AS node_title FROM node node  INNER JOIN users users ON node.uid = users.uid LEFT JOIN node node_users ON users.uid = node_users.uid AND node_users.type = 'academic_profile' LEFT JOIN biblio node_users__biblio ON node_users.vid = node_users__biblio.vid LEFT JOIN biblio node_users_node_users__biblio ON node_users.vid = node_users_node_users__biblio.vid LEFT JOIN biblio_contributor node_users__biblio_contributor ON node_users__biblio.vid = node_users__biblio_contributor.vid LEFT JOIN biblio_contributor node_users_node_users__biblio_contributor ON node_users__biblio.vid = node_users_node_users__biblio_contributor.vid LEFT JOIN biblio_contributor_data node_users__biblio_contributor_data ON node_users__biblio_contributor.cid = node_users__biblio_contributor_data.cid WHERE (node.status <> 0) AND (node_users__biblio_contributor_data.drupal_uid = 69)

you can see at the and that it looks like this: node_users__biblio_contributor_data.drupal_uid = 69 .. but it should have the uid of the node author, which is 1943.

if i do not use relationships, just simply use the argument, it works, but i want to use a relationship. any idea what is wrong with it?

many thanks, i love your module, keep up the good job!

aboros’s picture

Title: Can I use 'Biblio: Drupal UserID' with a relationship? » Enhancing Views compatibility

(sorry i didn't want to change issue title. changing back)

Dane Powell’s picture

I'm not sure why you need to use a relationship rather than an argument? Also you might want to open a separate support request instead of posting in a closed issue.