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 Your Modules Tables to Views Continued...

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 8 with Joe Shindelar]
  • 0:05
    Okay. Back to describing our field itself, though.
  • 0:08
    We've got the databasics view count field here,
  • 0:12
    we've given it a title and help.
  • 0:14
    We also need to tell Views some additional information about
  • 0:17
    how to deal with it in terms of the SQL portion of this,
  • 0:22
    how to use the view count field inside of a query.
  • 0:26
    We also need to tell it some more information about
  • 0:29
    how to deal with it when it's displaying it and so forth.
  • 0:33
    In order to do that, we need to tell Views which handlers it should use
  • 0:02
    [Codificando para Views para Drupal 7] [Capítulo 8 com Joe Shindelar]
  • 0:05
    Okay. Voltando para a descrição do nosso field.
  • 0:08
    Temos o field da contagem de visualizações Databasics aqui,
  • 0:12
    demos a ele um título e ajuda.
  • 0:14
    Também precisamos dar informações adicionais a Views sobre
  • 0:17
    como tratar com isso em termos da parte SQL disso,
  • 0:22
    como usar o field view count dentro de uma query.
  • 0:26
    Também precisamos dar mais informações a isso sobre
  • 0:29
    como tratar a exibição e por aí vai.
  • 0:33
    Para fazer isso, precisamos dizer a Views quais handlers isso deve usar

Exposing Your Module's Tables to Views Continued...

Loading...

In this video Joe continues the discussion of using hook_views_data() to describe a module's table to the views module. Building on what was covered in the previous chapter we now deal with exposing one of the individual columns from our table as a field that views can use for filters, sorts, and to display.

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

Modules Needed