Posted by markwk on July 27, 2011 at 5:48am
I'm working on creating a drupal 7 clone of LaunchRock.com, a way to create a pre-launch page. Basically it's a a simple page with sign up for a mailing list and some social media links for fblike, tweet, googe+1. The layout is focused on a simple box in the center of the page with an adjustable background image.
So, my question is: how would I make it possible for people to add their own background image?
(For anyone interested, the project is current hosted here: https://github.com/markwk/backdrop (theme) and https://github.com/markwk/comingsoon_features(features).)

Comments
background image
Assuming they are a member, create a node type that allows them to upload a file. Use FileField Paths along with Tokens to automatically rename the image and place it in the directory of your choice. Then take a look at replacing the background image by using a jQuery statement. Another method would be to place some logic in your template file to test if the user has saved a custom image and then use it, otherwise stick with the standard background. This is assuming that you only want them to see their own replacement image.
Now someone else can give a really simple and elegant answer:)
Good luck.
Have you looked at some of
Have you looked at some of these projects:
http://drupal.org/project/bg_image
This one integrates with panels: http://drupal.org/project/dynamic_background
Create a field to hold your
Create a field to hold your image.
In your node.tpl.php file, you can add your background image as inline CSS, using the style tag.
e.g.
<div id="my_content_wrapper" style="background-image: url('<?php print $node->field_background_image['und'][0]['uri']; ?>');">
<p>Lorem ipsum etc... </p>
</div>
You might need to do some wrangling to get the image path working correctly .. alternatively you could use imagecache to resize / alter the image prior to display.
EDIT: removed info about theme('image_style .. as it's not relevant at all.
Thanks for the ideas. But
Thanks for the ideas. But what I want is the ability for a site builder to throw this "Coming Soon" stuff up really easily so I was hoping to figure out how to get this logic into the the theme settings so they can upload / add a background like that. It really isn't for individual users but for the site admin to do with their pre-launch.
I suppose I'll need to dig more into theming for Drupal 7 for this one. Dev Seed's Singular D6 theme has this function, but couldn't get it to work for D7.
In walks Jquery.
Has anyone looked at Backstretch for this? Has anyone had a look at implementing Jquery Backstretch on this? I know that it can be done and implemented for Jquery dynamic resizing. Any suggestions for accomodating dynamic Theming practice into this?
The background image could be selected based on a user or by The Admin, based on The Node.
Bg module sorts you out some of this.
http://www.alltooeasy.co.uk
In walks Jquery.
Has anyone looked at Backstretch for this? Has anyone had a look at implementing Jquery Backstretch on this? I know that it can be done and implemented for Jquery dynamic resizing. Any suggestions for accomodating dynamic Theming practice into this?
The background image could be selected based on a user or by The Admin, based on The Node.
Bg module sorts you out some of this.
http://www.alltooeasy.co.uk
you could just use a Local
you could just use a Local CSS file and set the background to site/default/files/(image.png) location and then use file uploader module to upload background image with the right name ie bg.jpg or bg.png, on 6 I use to do this from flickr url.
re backstretch I achieved this at me5h.com with CSS using, background-size: cover I also have the menu fixed at the bottom of the page. You could also copy the edit the code for the image in the header and have it on the theme setting page... maybe?
Backdrop theme
Very nicely done Mark, really like this.
ComingSoon Distro
Ok. For anyone still following the progress of this one, I (finally!) released a distro that concisely creates a comingsoon site with a simple theme for just a background image using dynamic_background. If you are interested you can find it here: http://drupal.org/project/comingsoon
This is great! Cheers man,
This is great! Cheers man, will be taking a look.
Dynamic Banner
Dynamic Banner is a module that lightens the load on web developers from creating many blocks for pages with different banners.
This module will read from the drupal database to automatically decide which banner goes on which page.
http://drupal.org/project/dynamic_banner