Random background in Acquia Slate

Hello! I am the proud user of Acquia slate and was wondering if I could somehow rotate the background of the front page on a refresh. Would I use a PHP script with a bunch of images in a directory, or can I use gallery2, which I've already set up.

The web addresses are here:

Drupal site: http://www.claudebing.com
Gallery site: http://gallery.claudebing.com

The album "Backgrounds (Rotating)" is the album of images I want to use on the front page. They're already all the same size and dimensions. Any hints?

Groups:
Login to post comments

Got it figured out. Best

meinemitternacht - Fri, 2009-07-03 18:45

Got it figured out. Best and easiest way is a PHP script, called by the CSS file background image URL property. Here's what I used:

http://sonspring.com/journal/easy-random-css-backgrounds


Just figured I would throw

tommyent - Fri, 2009-07-03 19:05

Just figured I would throw it out there.

ddblock
http://ddblock.myalbums.biz/
http://drupal.org/project/ddblock

I was actually going to try and do this at some point.


how exactly is this done

Paul M - Sat, 2009-07-04 21:33

Hi can you give more specifics of exactly how this is done, as I am fairly new to drupal thanks

Paul


Are you referring to my

meinemitternacht - Sun, 2009-07-05 13:04

Are you referring to my method, or the other one?


rotate.php method

Paul M - Sun, 2009-07-05 16:00

Hi meinemitternach

I am referring to your method. I had a look at your site and this is what I'd like to do. I understand about putting the rotate.php in the same folder as the banners but don't know what files and how they should be modified to get it to point to this file.

Paul


Ok, sorry for the delay.

meinemitternacht - Tue, 2009-07-07 10:40

Ok, sorry for the delay. What you will need to do is the following.

If you're using Acquia Slate (which I'm sure you are), you need to go to /themes/acquia_slate and edit style.css

The style you want to edit is preface-wrapper, like so:

#preface-wrapper {
  background: transparent url('http://www.yourdrupalsite.com/rotate.php') no-repeat

Save the file. Now, upload rotate.php to your site base directory after you make this change:

$folder = '/var/www/vhosts/claudebing.com/httpdocs/images/bg/';  <--- this folder location is the absolute directory path to your images, including the trailing slash.

If you cache your site, go to drupal-admin/performance and clear your cached data.

That's it! enjoy your rotating background :)


my background doent not appear

xramx - Tue, 2009-08-04 12:25

i have followed the tutorial from meinemitternach..., and i was try edit preface-wrapper in local.css too both of them isn't work,
my background does not appear. any solutions?

info :
i'm using acquia_slate stable.

thanks.


Don't edit the style css

tommyent - Tue, 2009-07-07 11:03

Save yourself some trouble rename the local_sample.css to local.css and add the changes to it that way you avoid having complications when updates come out.

http://drupal.org/node/418326#local-css


Don't edit local.css

wretched sinner - saved by grace's picture
wretched sinner... - Tue, 2009-07-07 11:56

I agree that you don't want to edit style.css, but because we have to basically redefine the whole section, it is simpler to replace the whole section. There are a number of definitions for I have changed for specificity, and trying to override in local.css makes the job harder.