my code stock.com

Daniel Zas

Módulo que crea un bloque de pestañas cuyo contenido son vistas
by Daniel Zas

Requiere el módulo Quicktabs de Drupal

Snippet options

Download: Download snippet as modulo-que-crea-un-bloque-de-pestanas-cuyo-contenido-son-vistas.php.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

<?php
function saniyou_clinica_block_info(){
    $blocks['bloque_quicktabs_clinica'] = array(
    // Título del bloque en la configuración del administrador 
    'info' => t('Pestañas'),
    'cache' => DRUPAL_NO_CACHE,
  );
  return $blocks;
}


/**
 * Implementa hook_block_view().
 */
function saniyou_clinica_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'bloque_quicktabs_clinica':
      $block['subject'] = '';
      $block['content'] = pestanas_clinica();
      break;
  }
  return $block;
}

function pestanas_clinica() {
 if (arg(0) == 'node' && is_numeric(arg(1))) $nodeid = arg(1);

$tabs = array(
    $tabs[] = array(
      'title'   => t('Comentarios'),
      'type'    => 'view',
      'vid'     => 'comentarios_de_clinicas_facebook',
      'display' => 'block',
      'args' => $nodeid,  
    ),

    $tabs[] = array(
      'title'   => t('Mapa'),
      'type'    => 'view',
      'vid'     => 'mapa_por_clinica',
      'display' => 'block',
      'args' => $nodeid,  
    ),
    $tabs[] = array(
      'title'   => t('Tratamientos'),
      'type'    => 'view',
      'vid'     => 'tratamientos_por_clinica_2',
      'display' => 'block_1',
      'args' => $nodeid,
    ),    

);


// Configure the QuickTabs options
$quicktabs_options = array(
   'style'   => 'Garland',
   'ajax'    => FALSE,
);

$quicktabs_name = 'dynamic_quicktabs_menu';
$quicktabs = quicktabs_build_quicktabs($quicktabs_name, $quicktabs_options, $tabs);
return $quicktabs;
}

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.