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.

Writing Custom Field Handlers Continued...

Video loading...

Transcripts: 
Transcript language code: 
eng
Transcript language code: 
por_br

Join Drupalize.Me to watch this video

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

Log in Sign up
  • 0:03
    [with Joe Shindelar]
  • 0:04
    We're just going to do a simple select statement on the databasics table.
  • 0:08
    We're going to sum the view count field where node ID equals the node ID.
  • 0:14
    However, I need to know what that node ID is so I can perform that select query
  • 0:19
    and get a sum that I can use to calculate a percentage.
  • 0:23
    Where am I going to get that from?
  • 0:25
    It's not part of this values array currently.
  • 0:27
    In some cases that node ID could be part of the view already.
  • 0:31
    For instance, if I had added the node field here,
  • 0:36
    said add the NID field, that NID would show up in this list of values here.
  • 0:03
    [Com Joe Shindelar]
  • 0:04
    Iremos fazer apenas uma declaração SELECT simples na tabela Databasics.
  • 0:08
    Iremos somar o field view count onde o node ID seja igual o node ID.
  • 0:14
    Porém, eu preciso saber qual é esse ndoe ID para que possa realizar essa consulta SELECT
  • 0:19
    e obter uma somo que possa usar para calcular o percentual.
  • 0:23
    De onde irei pegar isso?
  • 0:25
    Não é parte do array values atualmente.
  • 0:27
    Em alguns casos esse node ID pode ser parte de uma view.
  • 0:31
    Por exemplo, se eu tivesse adicionado o field node aqui,
  • 0:36
    quer dizer, o field NID, esse NID iria aparecer nessa lista de valores aqui.