Make a swf file available in your template.
Last updated on
30 April 2025
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
So there is a flash file used in the sites template, ie. on every page. This is a very simple example to illustrate method. You can see that width, height are based on the flash file, usually we force this to be exact for a template since it will often line up with non-flash elements. Also, a background color is set.
In your _phptemplate_variables section of your template.php, add this in side the case 'page': switch.
function _phptemplate_variables($hook, $vars) {
switch($hook) {
case 'page' :
$vars['swf_logo'] = swf(
"http://example.com/files/banner.swf",
array('width' => '420', 'height' => '140', 'bgcolor' => '#336699'), FALSE,
array('html_alt' => '<h1>Name of site if flash is disabled.</h1>')
);
break;
}
return $vars;
}
Then in the page.tpl.php:
print $swf_logo
at the appropriate spot.
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion