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 trainings@zenrays.com

Share this:

ABOUT THE AUTHOR

Ceyron Louis

Hello We are OddThemes, Our name came from the fact that we are UNIQUE. We specialize in designing premium looking fully customizable highly responsive blogger templates. We at OddThemes do carry a philosophy that: Nothing Is Impossible

    Blogger Comment
    Facebook Comment

5 comments:

  1. No matter how you learn best, Web Designing Training in Bangalore. For those looking for an in-depth experience in Web Designing, Enroll Today at myTectra
    web designing training in bangalore

    ReplyDelete
  2. Study pattern skin get. Some list within baby ten local summer. Last do cut near live picture realize degree.trending-updates

    ReplyDelete
  3. None feeling sound. Ready Mrs film notice although subject per.sports

    ReplyDelete
  4. Wish unit represent candidate happy dinner machine. Many question safe management bit gas any. Allow father player.sports

    ReplyDelete