In Drupal Views, we can theme the output HTML by applying different .tpl.php in the Views admin UI. But there is not an option for theming an exposed filter. Actually, we can do it in the same way. Continue reading Drupal – Theme the Exposed Filter Form in Views
Category Archives: CMS
Drupal – Render a View in PHP Code
We can render a block in PHP as we discussed previously.
Drupal – Render a Block in PHP Code
This time, we want to render a view display by using the views_embed_view(). Continue reading Drupal – Render a View in PHP Code
Drupal – Render a Block in PHP Code
You can render a block in PHP as follow.
...
$block = (object) module_invoke('<module>', 'block', 'view', "<block id>");
print theme('block', $block);
...
Drupal – Add more content to a specific view using hook_views_pre_render
We can use the hook_views_pre_render to insert extra content before or after the view content.
custom.module Continue reading Drupal – Add more content to a specific view using hook_views_pre_render
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
Drupal – Custom PHP code for Views Field
The Views Custom Field module makes Views highly customizable. You create a HTML markup or PHP code snippet as a field which could retrieve and manipulate any data from the database. Continue reading Drupal – Custom PHP code for Views Field
Drupal – Distorted GMap in Quick Tabs
The GMap module is a great tool to display Google map in Drupal. But when i try to render the GMap in Quicktabs, it is always distorted. Continue reading Drupal – Distorted GMap in Quick Tabs
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
Drupal – Add Checkbox in Webform
We can add checkbox in Drupal Webform. Add the following field in your webform node.
Continue reading Drupal – Add Checkbox in Webform