Getting node data from a 'user' view

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by chrisrikli-gdo on March 8, 2009 at 1:55am

My apologies if this question should belong in either the OG or CCK groups; this seemed to me to be the appropriate place to ask since the core of my question relates to creating a View.

I have a node type "Accounts" that is an OG node. "Accounts" has one CCK user-reference field added.

I have a node type "Transactions" that is an OG post, intended to be posted only to the OG "Accounts." Transactions also has one CCK user-reference field.

When I create a "Transaction" (the OG post) I want to have checkboxes displaying only the users referenced by the "Account" (the OG node).

So, for example, I say I have two "Accounts":
Account A
- user-reference field contains "John" "Jack," and "Jim"
Account B
- user-reference field contains "Evan," and "Elijah"

When I create a "Transaction" for "Account A", I want to present a checkbox with John, Jack, and Jim as options.
When I create a "Transaction" for "Account B", I want to present a checkbox with Evan and Elijah as options.

I've tried so set the user-reference field for Transactions to a View...however it seems that only Views of type "user" are allowed. But the only relationship type available is the OG Members relationship and for various reasons I need the users reference to not be members of the group.

So...what it comes down to is this: is there a way to create a View of "user" type AND bring in node content from a node that contains a user-reference CCK field?

Comments

Ok, to simplify this, all

Posted by chrisrikli-gdo on March 8, 2009 at 6:00pm

Ok, to simplify this, all I'm trying to do is create a relationship to a node via a CCK user reference field from a View of type user. Is this not possible or am I just a moron (this is, in fact, the more likely of the two options)?

It may be that CCK only

Posted by merlinofchaos on March 12, 2009 at 6:22pm

It may be that CCK only supports the relationship unidirectionally and will require a patch to support a bidirectional relationship.

perhaps

Posted by mrfelton on April 1, 2010 at 5:37pm

--
Tom
www.systemseed.com - drupal development. drupal training. drupal support.

Getting data from Views

Posted by willsmith308 on October 5, 2010 at 2:22pm

Hi I have a list a view and I want to get a row and add up the elemenets of the row nay idea how to do that ?

Hi I have a list a view and I

Posted by scottprive on October 5, 2010 at 3:06pm

Hi I have a list a view and I want to get a row and add up the elemenets of the row nay idea how to do that ?

Please post your question as a new topic. This is for maximum visibility of your question, courtesy to the original poster, and it will create a question/answer page forever indexed by Google.

Of the top of my head, there is not a built Views UI feature to add up a column, but there -is- more than 1 solution... post your new topic and you will get some comments.

Two other approaches

Posted by scottprive on October 5, 2010 at 2:54pm

I've had to create some views that did backreferencing against NodeRef (ie, "show me all the Node Reference pointers which link to this-node"). In a general sense, it sounds like a similar problem in that you are trying to force in data fields and types which the current UI does not handle.

My 2 suggestions are just things I know will work. I have not tried Tom's suggestion, and his pointer might be the easiest or most practical (I just do not know anything about it).

a) Install Views CustomField
Use PHP in your Views. Use Views CF in your Fields.

b) Export your Views.
Don't forget that you will ultimately be exporting your Views for performance reasons. When you do, more options become available because Views UI is a "helper" to the Views API - Views UI is not 100% of the story. When you export your views, you can do crazy things (actions not UI-unsupported) like combining 2 views together or using Arguments as Filters, etc.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /