Category Archives: CMS

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

Magento – Find out the template path of specific content

I just start working with Magento and it is quite different from Drupal. Probably i need to spend more effort on it before we become friends. =P

After the installation, i found that i have no way to change the content in the right sidebar. I know i need to edit some template files but i have no idea which one i should edit. After spending an hour on Google, i figured a way to determine the template path. Continue reading Magento – Find out the template path of specific content