Drupal view with node reference and cck3 multigroup field
I'm using Views2 and cck3 and am having trouble creating a Drupal view that allows me to display multigroup fields while using arguments.
Content Types:
- Person (Fields: title)
- Quote (Multigroups: quote, Fields: person_name, text)
Inside of the person content type I've got a field for name (title). Inside of the quote content type, I've got a multigroup field that contains two other fields. The first is a node reference to the person content type, and the second is a text field (what is being quoted).
The thought behind this is that what is being quoted could be a dialog between 2 or more people, which is why this is in a multigroup.
QUOTE 1
person a: lorem ipsum person b: lorem ipsum dolor person a: sit ametQUOTE 2
person c: new quote text from a new personQUOTE 3
person a: new quote text
I'm able to create a view that displays all of the quotes and groups dialogs similarly to how is displayed above, however I can't figure out how to create a view that does the same thing but using the person as an argument.
I don't want to use a filter as I want the url to be /quote/person-name.
When going to /quote/person-a it should return the entire quote for all multigroups that contain Person A.
QUOTE 1
person a: lorem ipsum person b: lorem ipsum dolor person a: sit ametQUOTE 2
person a: new quote text
but what I get are items that only contain Person A.
QUO开发者_Python百科TE 1
person a: lorem ipsum person a: sit ametQUOTE 2
person a: new quote text
Playing around with various view options (like relationships) I was able to create this:
QUOTE 1
person a: lorem ipsum person a: lorem ipsum dolor person a: sit ametQUOTE 2
person a: new quote text
It contains all items in the multigroup, quote, but replaces all of the names with Person A.
I'm not familiar with Multigroup, so I'm not sure if it's possible solely using Views, but I can think of two alternatives:
1) Use a Taxonomy and "tag" your Quotes with the names (or node IDs) of the people involved. This can be set up so that the tags are automatically added/updated whenever a Quote is saved.
2) Add a Computed Field to the Quote type that will hold the names as a string with some delimiter (for example, "/"). Then you can simply add an argument using that field (with the Contains operator).
精彩评论