Drupal 6 get theme template suggestions
This is how you get theme template name suggestions from your theme template.php file
This is how you get theme template name suggestions from your theme template.php file
In some themes you have to style the dropdownbox and it can be hard to catch it in Firebug.
If your theme has a template engine you can override a theme function in both your module and in your theme template.php
To override the function call theme('item_list') you have to copy the original function named theme_item_list and add it to your module or template.php replace theme_ with phptemplate_ and make your changes to the code.
Sometimes you want to add classes to the body tag to able to theme the site as you want it. Here is one way of doing it by changing a function call in page.tpl.php and add some code to the function phptemplate_body_class() in template.php.
Having a hard time to catch the Drupal AHAH animation in Firebug? This is how it looks like. Add it after your button in Edit, and now you can style it.
<?php
<input type="submit" name="op" value="Go" class="form-submit ahah-processed progress-disabled" id="edit-go">
<div class="ahah-progress ahah-progress-throbber" style="display: block;">
<div class="throbber"> </div>
</div>
?>
This is how you can change theme on a single view programmatically based on path. In my case I have made some own modules and I want those views using the current admin theme instead of the default theme. I let the path decide what theme to use in hook_init. I also thought it all user views should have the admin theme.
This is how you can affect variables before sent to theme templates based on the URL. In this case I had to remove an empty sidebar in RootCandy theme.
<?php
/**
* Implementation of hook_preprocess_page().
*/
function support_filter_preprocess_page(&$vars) {
if (arg(0) == "domainuser" OR arg(0) == "support_filter") {
unset($vars['admin_left']);
}
}
?>
Don't forget to rebuild theme registry by use admin_menu modules Flush all caches > Theme Registry or drupal_rebuild_theme_registry();
This is how you can set up your own theme function and converting the same data sent to Drupal theme function for "table" and instead get it as a DIV structure. You need to add some CSS or styling the DIV structure to make it look like desired. This code is for a module.
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.
If you want to add a template file you have to rebuild your sites theme registry.
Put this first in template.tpl.php: