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.

Adding Fields that do not Exist in the Database

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:03
    [Chapter 12 with Joe Shindelar]
  • 0:05
    In this chapter, we're going to look at how we can create a new field handler
  • 0:09
    that adds an additional field to our databasics table that didn't exist before.
  • 0:15
    So the table only has 4 columns, but we want to add a fifth column that Views can know about.
  • 0:21
    What this does is allow us to make a more intuitive user interface for a site administrator.
  • 0:25
    And an example of this would be the way that the Node Module exposes its data to Views.
  • 0:31
    When you're creating a new view, you can create a node edit link
  • 0:34
    by just selecting the node edit field in the Views' UI.
  • 0:38
    There isn't, however, a column on the node table for edit this node.
  • 0:42
    So VIews is creating a new pseudo field that provides an output
  • 0:03
    [Capítulo 12 com Joe Shindelar]
  • 0:05
    Nesse capítulo, iremos dar uma olhada em como podemos criar um novo field handler
  • 0:09
    que adiciona um field adicional a nossa tabela databasics que não existia anteriormente.
  • 0:15
    Então a tabela tem apenas 4 colunas, mas queremos adicionar uma quinta coluna que possa ser reconhecida por Views.
  • 0:21
    O que isso faz é nos permitir a fazer uma interface de usuário mais intuitiva para um administrador de site.
  • 0:25
    E um exemplo disso seria a maneira que o módulo Node expõe seus dados a Views.
  • 0:31
    Quando você está criando uma nova view, você pode criar um link de edição de node
  • 0:34
    selecionando apenas o field de edição de node na UI de Views.
  • 0:38
    Porém, não há uma coluna na tabela node para editar esse node.
  • 0:42
    Então Views está criando um novo pseudo field que fornece uma saída

Adding Fields That Do Not Exist in the Database

Loading...

In this video we'll look at adding yet another field handler, but in this instance we will be adding a Views field that does not directly map to an actual field in the database. Instead we will be creating our own variation on some data and adding it as a field that can be used in our views — a field that shows the percentage of page views as a black bar graph.

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

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.