Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Exposing More Fields and Adding Relationships

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:02
    [Coding for Views for Drupal 7] [Chapter 9 with Joe Shindelar]
  • 0:05
    This video continues the process of describing our module's data to the Views Module.
  • 0:10
    We'll take a look at describing the rest of the fields from our databasics table,
  • 0:14
    and in addition to that, we're also going to take a look at how we can create
  • 0:18
    joins, or relationships, between the fields on our table and the fields on another table.
  • 0:23
    For example, our databasics table has an NID column, that is a foreign key
  • 0:29
    for the NID column, on the node table.
  • 0:32
    So we're going to take a look at how we can create that relationship
  • 0:34
    between the databasics table and the node table so that in Views
  • 0:38
    we can pull in additional information about the nodes.
  • 0:02
    [Codificando para Views para Drupal 7] [Capítulo 9 com Joe Shindelar]
  • 0:05
    Esse vídeo continua o processo de descrição dos dados do nosso módulo para o módulo Views.
  • 0:10
    Iremos dar uma olhada na descrição do resto dos fields da nossa tabela databasics.
  • 0:14
    e em adição a isso, também iremos dar uma olhada em como podemos criar
  • 0:18
    joins, ou relacionamentos, entre esses fields na nossa tabela e fields em outra tabela.
  • 0:23
    Por exemplo, nossa tabela databasics tem uma coluna NID, que é uma foreign key
  • 0:29
    para a coluna NID, na tabela node.
  • 0:32
    Então iremos dar uma olhada em como podemos criar esse relacionamento
  • 0:34
    entre a tabela databasics e a tabela node para que em Views
  • 0:38
    possamos puxar informações adicionais sobre os nodes.

Exposing More Fields and Adding Relationships

Loading...

In this video Joe describes the process of adding the rest of the fields from the databasics module to our implementation of hook_views_data() including how to differentiate between different data types like strings of text and numeric values and how this changes the views module's behavior. Then Joe talks about how to tell views about various tables that can be used in relationship to the databasics table via foreign keys like the node ID.

Downloads: 
Log in or sign up to download companion files.
Additional resources: 

Modules Needed