Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Adding relationship to view

View modules allows to fetch the content from site's database and present it to the user as they need. After creating a view for the first time, we can  select the base table from options such as users, taxonomy terms, comments, content which cannot be changed later. Once it is done, you can select fields from that base table.


Views Relationship is all about how one piece of content relates to another. Relationship is used to join two types of contents. To add a relationship to a view navigate to structure >> view >> select a view to which relationship has to be added. Click on advanced settings, in the relationship section click on add.

Lets continue with an example with a Content view. With content view, one can get the User ID of the Author, but not the username of the author. To get that, relationship has to be created to join those two tables. With the connection of User ID, author's username can be obtained from the user table.
Search for author and select content author and click apply.
Next under fields section click add. Select the chosen relationship as user. Select user name and click apply.
Next you can configure how the field displays. The defaults in this case will append a field label and make the field a link to the user. Change the label to Author. Click Apply.Finally we can  preview to see content listing, including the username of the author.
ZenRays provide the following to make you expert
zenrays providing  drupal training in Bangalore
  1. Fully practical and project-based sessions from first class.
  2. Training by Experienced Consultants, not regular Trainers
  3. Friendly and enthusiastic faculty to clear your doubts 24X7
  4. Free Live project after the training to get you industry experience
If you want more details please visit us:
Zenrays.com Reach us at [email protected]


This post first appeared on Best Software Training Institute In Bangalore, please read the originial post: here

Share the post

Adding relationship to view

×

Subscribe to Best Software Training Institute In Bangalore

Get updates delivered right to your inbox!

Thank you for your subscription

×