You can render a block in PHP as follow.
...
$block = (object) module_invoke('<module>', 'block', 'view', "<block id>");
print theme('block', $block);
...
You can render a block in PHP as follow.
...
$block = (object) module_invoke('<module>', 'block', 'view', "<block id>");
print theme('block', $block);
...
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
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
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
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
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
We can add checkbox in Drupal Webform. Add the following field in your webform node.
Continue reading Drupal – Add Checkbox in Webform
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
We can theme the cart page by the theme_uc_cart_view_form() function. Implement it in your theme template.php. Continue reading Ubercart – Theme cart view in cart page
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