Tag Archives: Drupal Development

Drupal – Add Image to Apache Solr Search Result

Apache Solr is a very good web search engine and it works very well with Drupal. This post shows you how to customize the default pure text search result template by adding node image to each result record.

First, we need to load the corresponding node for each search result. This can be done in the <theme>_preprocess_search_result(&$variables) function. Add it to the template.php. Continue reading Drupal – Add Image to Apache Solr Search Result

Drupal – Quick Tabs Deep Linking

The Quick Tabs allows you to aggregate different content in a single page using tabs. You can either load all the tabs at once or use Ajax to retrieve the tab content. But in both cases, you can’t get the direct link of a specific tab.

So i create the following Javascript to tackle this problem. After applying it, the page will reload every time when the user click the tab and the URL is also updated. Continue reading Drupal – Quick Tabs Deep Linking

Drupal – Form Path Problem of Exposed Filter Block in Panel Page

In Views, we can make the exposed filter into block and therefore we can select it for Panel page. But this would not work because after the filter form submission, it will redirect to the view page rather than the current panel page.

Luckily, i found a solution to resolve the issue. Continue reading Drupal – Form Path Problem of Exposed Filter Block in Panel Page

Drupal – Add HTML Markup in Form

I would like to add some HTML elements in the login form. This can be done by hook_form_alter() and the markup could be added as follow.

function <your module>_form_alter(&$form, &$form_state, $form_id) {
  //print $form_id.'<br/>';
  if ($form_id == 'user_login') {
    //print_r($form);
    $form['html_markup'] = array('#value' => t('<a href="https://ykyuen.wordpress.com">Eureka!</a>'));
  }
}

 

Done =)

Reference: Drupal 6 Form API Reference