I've been trying to replace the rotating header images with a single embedded flash file, but haven't had much luck. I'm not sure if i'm not using the correct code to embed the swf or am putting it the wrong folder.

Thanks!

Comments

plixel’s picture

Title: Flash Header » Rotating Banner -> Flash Header
talktozee’s picture

In page.tpl.php, find:

<div id="header">
<?php if ($site_name) : ?>

Insert the following after the header DIV if you want the front page to have Flash and all other pages to have static images:

	<?php $homepage = "/"; ?>
	<?php $currentpage = $_SERVER['REQUEST_URI']; ?>
	<?php
	if($homepage==$currentpage){
    	  print '<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
	}
          else { print '<img width=970 height=200 src=yourstatic.jpg />';
	}	 
	?>

If you want Flash on every page, remove the conditional statements and just do a print of the Object/Embed line. The height and width dimensions might have to be adjusted a bit, so be aware of this.

You'll also need to REM out the rotate.php line in the graphics.css file:

#header {background: #E34A10;}
/* url(img/banners/rotate.php) no-repeat 0px 0px; /*rotates images in the banners folder */} */
signal000’s picture

I followed this and put the yourflash.swf in the img/banners/ folder and its still not working ?

bhardy101’s picture

Ok, I've tried this for a bit now. I just want my flash to replace the image that makes up the header for the marinelli theme. this is what i've got.

 <div id="header">
<?php if ($site_name) : ?>
<?php $homepage = "/"; ?>
<?php $currentpage = $_SERVER['REQUEST_URI']; ?>
<?php
    if($homepage==$currentpage){
          print '<object width="970" height="200" wmode=transparent><param name="movie" value="global.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="global.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="200"></embed></object>';
    }
          else { print '<img width=970 height=200 src=yourstatic.jpg />';
    }    
    ?>
 

All i get is my one image, which i dont want anyway. If i delete the image, the header is just blank. Since i didn't know where to put the flash, it's in the root directory as well as the /themes/marinelli/img/banners/ folder. I'm a newb, thanks in advance for the help.

bhardy101’s picture

Ok, i got it. I needed to put the code inside the header. Now its on the top, and on the top on all the pages. This is what i wanted. i edited the page.tpl.php that was in the themes/marinelli/giordani folder. Giordani was the theme i had selected. Hope this helps out.

Global Decompression
http://www.globaldecompression.com

<div id="header" <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="970" height="180" id="http://www.yourpath.com/flash.swf" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="http://www.yourpath.com/flash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#000000">
<embed src="http://www.yourpath.com/flash.swf" quality="high" bgcolor="#ffffff" width="970" height="180" name="http://www.yourpath.com/flash.swf" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</object>
TravieMo9’s picture

I added Flash header with the instructions in bhardy101 comment #5 above. It worked but then my Administration Menu "administration_menu module", and Primary Links went under it. Adding z-index to the div didn't help.

Gullimont’s picture

bhardy's method worked perfectly for me, thanks very much!

riote’s picture

instead of using a url, use the base_path just to make it easier when you move your site..

print $base_path /themes/marinelli/img/yourflash.swf"

So...

willisjt’s picture

Re:#6
TravieMo9

Adding

<param name="wmode" value="transparent" />

as a param solves this issue in all browsers accept for safari.

willisjt’s picture

I still haven't been able to get the drop downs to go over top of the flash in IE8 using any of these scripts, my site is live and i just noticed the issue. It's in a sort of soft launch mode right now so I can keep it up with the flash for a little while but I really don't want to go back to the static images. The site is http://www.wrighthealthcentre.com

archetypemkt’s picture

I'm having problems getting the flash to work on "non-primary" links. The flash works on primary and secondary links but if you link in (i.e., click on a blog entry, form, etc.) you get a blank header. I look at the source code and all the flash is there. I've even tried to upload the flash file to the specific template directory as well as .....actually I have tried everything under the sun to make the flash show up on secondary pages but it doesn't.

Since the header block doesn't work inserting it that way isn't an option without changing the template. I'm trying to get away from that and am just looking for an easy fix.

Any help would be great. http://www.cacem-intl.com (you can see flash image on primaries and then the static on deeper linked pages).

BeMathis’s picture

<?php
    if($homepage==$currentpage){
          print '<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
    ?>

worked fine for me but when I go to any page that is www.example.com/node/ The banner reverts back to the rotate the php and is no longer my flash.

If i do removed the css line that sets up the rotating banner then i just get no banner. Any ideas on what may be causing this?

willisjt’s picture

It's because you have your code in the if statement checking to see if the current page is the home page. Take it out and it should work fine.

<?php
          print '<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
    ?>

make sure you find the other } it wasn't in the code snippet you posted. If you can't find it then just do this

<?php
          print '<object width="970" height="195" wmode=transparent><param name="movie" value="yourflash.swf"></param><param name="allowFullScreen" value="false"></param><embed wmode=transparent src="yourflash.swf" type="application/x-shockwave-flash" allowfullscreen="false" width="970" height="195"></embed></object>';
    if($homepage==$currentpage){
    ?>
pencilking2002’s picture

Hi. Wow this thread really helped me! thank you guys! I do have a question though. Is it possible to have the banner show up on the home page but not on all the other pages? Or maybe have a different Flash movie on the other pages? Thank you!!

libre fan’s picture

Wow why on earth inflict Flash on your visitors while Marinelli gives you a nice PHP piece of code? That beats me.
I here take the opportunity of saying many thanks to the Marinelli team for the rotating banners! :-)

manicolaus’s picture

I'll echo your praise to the makers of the Marinelli theme. I love it. But I modified it to use Flash because (a) the PHP code changed banners only when a user clicked, so to the first time visitor the image appears to be static, (b) being random, it frequently repeated the same banner, and (c) there was no possibility of a dissolve transition between banners or any other special effects. Add also the consideration that Flash runs client-side so that the slide show can run continuously without eating up bandwidth, whereas a server-side (php) slide show would quickly eat up the available traffic on my shared hosting account. That happened to me with one of the available Drupal slide show block modules; after half a day the site locked up, bandwidth limit exceeded. Bottom line: I love my Marinelli with Flash. See how it runs on http://sheilajordan.org.

libre fan’s picture

I understand your reasons, and I'm sure the effect is great (I use FlashBlock on Firefox, sorry). Yet I think yours visitors shouldn't have to have Flash installed on their computers. Some computer are very old and don't go well with Flash. Your visitors shouldn't bear the burden you don't want to bear (matters related to bandwidth).

I like the random effect, I like the fact the banners rotate only if visitors stay on a bit on the website. After all a website is there to be explored, not all the goodness has to be laid bare at first glance. Yet I guess you'll say rotating flashy stuff is arresting and will encourage visitors to start visiting your website.

I'll say web surfers are so bombarded with flash that they may be very blasé. Maybe they expect flashy stuff, so they'll approve and just pass on to another flashy or flashier website.

But if a visitor doesn't have the Flash plugin, she won't see a thing. If her computer is old or her connection is bad, she'll get a bad experience of the website.

In other words, I'm on the side of content rather than presentation, and simplicity rather than sophistication, and visitors rather than webdesigners. Yet I love colours (flashy garish colours even) of the rainbow.

So I had a look at your website and was very interested to know how you placed images the way you do inside the text, but the page source shows you use frames, and then you insert image values in your HTML.

Well, not my stuff but the content of the website looks interesting.

kbellcpa’s picture

Can you help me? I have the same problem, but I don't know where to start. I want to change the rotating mountain to my own image. How do I open the page.tpl.php page?

jessmagz’s picture

If you just want to change or add your personally chosen images to the rotating banner images, just drop your desired images at this folder where your marinelli theme is using.

/sites/all/themes/marinelli/img/banners

kbellcpa’s picture

Thanks, I figured it out a couple of days ago. I just took the images out that came with the theme and put my own in.

ruloopy’s picture

Version: 6.x-2.4 » 7.x-3.0-beta6

I see the adjustment for replacing the rotator in the header with a flash .swf for Drupal 6.

Is there a work around for Drupal 7 yet?

If so, can you drop the code here?

Thanks