Tag Archives: Drupal

Drupal – Add page.tpl.php for different Content Type

In Drupal, we can determine the template files of the page which is going to be rendered. Add the following code in your template.php.

...
function <theme>_preprocess_page(&$vars) {
  // Drupal 7
  print_r($vars['theme_hook_suggestions']); exit();

  // Drupal 6
  print_r($vars['template_files']); exit();
}
...

  Continue reading Drupal – Add page.tpl.php for different Content Type

Drupal – Sharing data across fields in the same row with Views Custom Field

We have talked about the Views Custom Field module previously. If you have no idea what is it for, you can take a look @ Drupal – Custom PHP code for Views Field.

Sometimes we may need to get a full node using Views Custom Field. For example, i want to get the number of images of a node. Continue reading Drupal – Sharing data across fields in the same row with Views Custom Field

BeansTag – The SEO tool for Drupal 7

Next: BeansTag update

BeansTag is a page title, meta tag and meta description management tool. It makes use of the path alias as an identifier for the SEO attributes. You could add them to any path alias and they would be shown in the webpage. It fully supports any pages including views, panel pages as well as nodes. Continue reading BeansTag – The SEO tool for Drupal 7

Drupal – Menu items were not expanded in multilingual site

Normally, the Drupal Menu will be expanded automatically whenever the menu item itself or its children are active. But if you have more than one menu item pointing to the same path such as having the same menu items in different language inside a menu, the auto expand does not work.

Applying the following patch to <drupal_root>/includes/menu.inc could solve the problem. Continue reading Drupal – Menu items were not expanded in multilingual site