Make a swf file available in your template.
Last updated on
30 April 2025
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