DRUPAL 7 - Módulo que crea un bloque de pestañas cuyo contenido son vistas

<?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; }
Requiere el módulo Quicktabs de Drupal

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.