I've chosen "custom module".
function my_module_block_info() { $blocks['quicklinks'] = array( 'info' => t('Quick Links'), 'cache' => DRUPAL_NO_CACHE ); return $blocks; } function my_module_block_view($delta = '') { $block = array(); # Declare array switch ($delta) { case 'quicklinks' : $options = array(); // Options for category combo // Getting terms from vocabulary "Category" $terms = my_module_taxonomy_get(4, 0); //echo '<pre>';print_r($terms);echo '</pre>'; $options['c-all'] = t('Choose a Category'); foreach ($terms as $term) { $options[$term->tid] = $term->name; } // Block View $block['subject'] = 'Quick Links'; $block['content'] = array( 'combo' => array( '#type' => 'select', '#default_value' => 'c-all', '#options' => $options, '#attributes' => array( 'id' => 'quick_links_select', 'class' => array('quick_links', 'select'), 'onchange' => 'my_module_browse_by_category()' ), ), 'links1' => array( '#type' => 'markup', '#prefix' => '<div class="quick_links top link">', '#markup' => l('Future icons Apps', base_path() . 'ours'), '#suffix' => '</div>', ), 'links2' => array( '#type' => 'markup', '#prefix' => '<div class="quick_links second link">', '#markup' => l("Editor's Choice", base_path() . 'editor'), '#suffix' => '</div>', ), 'links3' => array( '#type' => 'markup', '#prefix' => '<div class="quick_links third link">', '#markup' => l('Apps Starter Kit', base_path() . 'appstarter'), '#suffix' => '</div>', ), 'links4' => array( '#type' => 'markup', '#prefix' => '<div class="quick_links forth link">', '#markup' => l('Games Starter Kit', base_path() . 'gamestarter'), '#suffix' => '</div>', ), ); } return $block; } function my_module_taxonomy_get($vid, $get_base_term = FALSE) { // Getteing Terms $query = db_select('taxonomy_term_data', 't'); $query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid'); $result = $query ->fields('t') ->condition('t.vid', $vid) ->condition('h.parent', 0, '!=') ->orderBy('t.name') ->execute(); foreach ($result as $term) { $terms[] = $term; } return $terms; }
With above code, I got what I want. But I don't understand much about $block['content'] thing and how ['content'] is rendered.
Is there any sources which fully explain how it works ?
Thanks