template

Make changes to page with preprocess page in module

This is how you can make changes to a page view with preprocess page hook from your module

<?php
function support_bulk_preprocess_page(&$variables) {

//Print out to see all variables
 
?>

  <pre>
  <?php
      print_r
($variables);
 
?>

  </pre>
  <?php
 
exit;

  if (
$variables['node'] && arg(2) != 'edit') {
    
$variables['template_files'][] = 'page-'. $variables['node']->type;
  }


  if (
$variables['node']) {
    
$variables['body_classes'][] = 'page-'. $variables['node']->type;
  }

}
?>

Set page template file to use based on content type

If you want to change page.tpl.php to a different one based on the content type you can add a condition in preprocess_page function in your themes template.php file.
Probably you have a phptemplate_preprocess_page() or a [your_theme]_preprocess_page().

<?php
function phptemplate_preprocess_page(&$variables) {

  if (
$variables['node'] && arg(2) != 'edit') {
    
$variables['template_files'][] = 'page-'. $variables['node']->type;
  }
 
}
?>

Then make a copy of page.tpl.php and rename the copy to page-[your-content-type].tpl.php, and make the changes you want.

Manipulate breadcrumbs

First have a look in your theme settings example.com/admin/build/themes/settings/my_theme.

In Breadcrumb settings you can decide to display breadcrumb and breadcrumb separator. Select if you want to show home page link in breadcrumb and append a separator to the end of the breadcrumb, useful when the breadcrumb is placed just before the title. Append the content title to the end of the breadcrumb
Useful when the breadcrumb is not placed just before the title.

/**
* Make breadcrumbs include the current page as an inactive crumb

Remove CCK field from a view using template file

This is how to remove a CCK-field with a special condition. If you just want to hide the field in hull node and/or teaser view you can configure it at Manage fields / Display fields at your content type.

Don't forget to refresh your them registry before testing, otherwise you wont see any difference. If you are using the admin menu module ( http://drupal.org/project/admin_menu) you find it in the first menu, Flush all cashes /Theme registry.

Create a file, content-field.tpl.php, in your theme folder.

Add the following content to this file:

Embed Drupal views in content, template or in your module

This is how you can get the view embedded. Another nice little trick is to actually embed the view in the node content/body, template or a function in your module. This way you don't have to create a region just for the gallery system, and it is so simple that it would be a shame not to do it this way! The only thing you need to do is to edit the node template of your theme, and paste a little snippet of code that will tell drupal which view and which display to embed. The code is like this :

<?php print views_embed_view('view_name', $display_id = 'display_id');?>