Header Image Rotation in Drupal

gamehengraphics - December 18, 2006 - 21:14

I'm having a hard time getting our header image to rotate randomly. I've tried a javascript I've used succesfully in the past, and I've tried the old "rotate.php" document trick. Alas, neither is succeding, and I know I've got the code I'm using placed and called correctlly.

Does anyone have a good random image rotation code they've used succesfully within Drupal?

We're using the Interlaced theme at the moment.

Thanks in Advance.

Did you mean...

Csabo - December 18, 2006 - 21:27

Did you mean that a random image would show up each time the page is requested? We have that on our front page, the code is:

<img src="/images/front/makeover<?php print rand(1,5) ?>.jpg" width="290" height="195" alt="alt tag" />

We have 5 images named makeover1.jpg - makeover5.jpg. Pretty simple.

...

sepeck - December 18, 2006 - 21:55

Maybe this?
http://drupal.org/node/85640

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

Steven's link is great. I've

mirko - December 18, 2006 - 22:05

Steven's link is great. I've used the "A list apart" rotator, it works great.

Thanks, That was it!

gamehengraphics - December 18, 2006 - 23:22

The theme we're using is all CSS, so the php style of calling the rotate.php document wasn't working. One of the comments on http://drupal.org/node/85640 provides the little CSS tweak we needed.

 
 

Drupal is a registered trademark of Dries Buytaert.