[support] View Relationships Question

Michelle Ziegmann michelle at media.berkeley.edu
Mon Jun 14 17:23:06 UTC 2010


Steve,

Under Relationships, you should see all CCK nodereference fields as 
options to select. So if in your post, the field you use to reference 
the author node is field_page_author, then that field should appear as a 
Relationship to be added. Choose that field, and then the relationship 
will be available to use in your sort criteria.

To apply the sorting (after establishing the relationship), add a new 
sort criteria, choose the field you use for the last name of the author 
(e.g. field_author_lastname), and on the next screen, choose the 
relationship you created.

Hope that helps!
Michelle


On 6/14/2010 6:19 AM, skessler at denverdataman.com wrote:
> The problem is that when I go to the relationships in views I dont have
> those relevant fields available to me.
>
> How does views decide what you can reference? Can I force views to let me
> reference more?
>
>
> Thanks,
> Steve
>
>    
>> I struggle with relationships a little bit, but basically creating the
>> relationship just links the two nodes via the node id used in the node
>> reference field. Once that relationship is in place though you should be
>> able to pull fields from the related node (such as the surname you
>> mention) and then you can sort on it. When you add the surname it will
>> ask you if you want to use a relationship with it.
>>
>> The video in the first link below is a great primer and the second one
>> goes into a bit more detail.
>>
>> http://gotdrupal.com/videos/drupal-views-relationships
>> http://drewish.com/node/127
>>
>> Anthony.
>>
>> On 6:59 AM, Steve Kessler wrote:
>>      
>>> I have a resource node type that references the author(s) of the post
>>> via a node reference CCK field. The authors are not necessarily still
>>> living or using the site so they are just an author node type that has
>>> nothing to do with Drupal users. We want to be able to sort the
>>> resources by authors last name that is stored in the node for the
>>> author.
>>>
>>> Right now the node reference is based on title which is a
>>> concatenation of the title, first name, last name and suffix fields so
>>> it would be hard to write a regular expression to do this off of the
>>> title. We have examples of authors with and without middle names for
>>> example.
>>>
>>> I was thinking I could just create a relationship and then sort on the
>>> relationship but I don’t see this as an option in views.
>>>
>>> Thanks,
>>>
>>> Steve
>>>
>>> Steve Kessler
>>>
>>> *Denver DataMan *
>>>
>>> 303-587-4428
>>>
>>> Sign up for the Denver DataMan Free eNewslettter
>>> <http://www.denverdataman.com/denver-dataman-e-newsletter-signup>
>>>
>>> "Getting the */right information/*, to the */right people/*, at the
>>> */right time/*"
>>>
>>>        
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>>      
>
>    

-- 
Michelle Ziegmann
===========================
Electronic Communications Specialist
University of California Berkeley
Educational Technology Services



More information about the support mailing list