I have a background image on my homepage that was originally defined as a static JPEG image in my template CSS file. Please see code below:

#banner {
width:770px;
height:341px;
background: url(images/bannerbg.jpg) no-repeat left top;
margin-bottom: 10px;
}

I would like to REPLACE this JPEG with an SWF file and I believe to do this, I have to modify the page.tpl.php file. The code I think I have to replace is here:

if ($is_front) {

I'm not sure whether to edit both the CSS file and the PHP file, or just the PHP file. Further, I'm very unclear as to how to amend the current code to accommodate this new SWF file. It was designed to be exactly the same size etc as the existing JPEG file, so I thought this would be an easy fix... I've run into huge problems and can't find answers anywhere. I tried to install SWF Tools and just use the code:

print swf('mymovie.swf');

right beside

Comments

SchnWalter’s picture

you should enable PHP Filter (from drupal core)

then create a node that you set up as default front page in admin/settings/site-information
and for that node you should use PHP Filter and this code

// use with public files (check: admin/settings/file-system)
$movieSWF = file_directory_path()."/movie.swf";

// use with private files
//$movieSWF = "/movie.swf";

// set your width and height in pixels here
print swf($movieSWF, array('height'=>192, 'width'=>733));