[SOLVED]Background image not appearing

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

[SOLVED]Background image not appearing

Post by jasnick »

Have just come back from 5 weeks holiday and find I am very rusty when it comes to CMSMS. Was getting on very well before.

Have just started switching an existing site to CMSMS using latest version.

Existing site is at http://www.u3auwa.org. New CMSMS site is at http://westwebtest.com/u3auwa.org/

#container has a background image:
background: #fff url(uploads/images/bluebg3.jpg) top left repeat-y;

This is not visible. All I have done so far is to add a new template and a new CSS. Trying to get the first page layout right before adding menu etc.

Is there something I have forgotten to do?

Thanks
Last edited by jasnick on Sat Jun 04, 2011 8:59 am, edited 1 time in total.
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: Background image not appearing

Post by M@rtijn »

Hi,

When I change the link to that background to
it does work.

This gives me the feeling that somewhere either in .htaccess or in config.php the root url is not set correctly.

In your .htaccess is a line
#Sub-dir e.g: /cmsms
RewriteBase /

If your website is in a subfolder, it should read
RewriteBase /u3auwa.org/
(just a guess)

Also take a look at these lines in config.php:
$config['root_url']
$config['root_path']
$config['previews_path']
$config['uploads_path']
$config['image_uploads_path']
Make your community a better place!
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Background image not appearing

Post by jasnick »

Thanks M@rtijn - yes, it is in a subdirectory. Should have thought of that.

This is from the config file:

$config['root_url'] = 'http://westwebtest.com/u3auwa.org';

#SSL URL. This is used for pages that are marked as secure.
$config['ssl_url'] = 'https://westwebtest.com/u3auwa.org';

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/westtest/public_html/u3auwa.org';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily? It defaults to tmp/cache.
$config['previews_path'] = '/home/westtest/public_html/u3auwa.org/tmp/cache';

#Where are uploaded files put? This defaults to uploads.
$config['uploads_path'] = '/home/westtest/public_html/u3auwa.org/uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';


The first two lines use /westwebtest/ then it changes to /westtest/ for some reason. Am not clear what is correct here?

I set this site up in my testing directory (westwebtest.com)while I work on it so as not to interfere with the current site. I named the directory "u3auwa.org".

Thanks
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Background image not appearing

Post by jasnick »

I searched for all the .htaccess files associated with this site
/public_html/.htaccess - this was blank

/public_html/u3auwa.org/doc/.htaccess

/public_html/u3auwa.org/plugins/.htaccess

/public_html/u3auwa.org/uploads/.htaccess

/public_html/u3auwa.org/images/.htaccess

all the rest contained stuff like this:

# To deny PHPs
<Files ~ "\.(php|php3|php4|php5|phtml|pl|cgi|txt)$">
order deny,allow
deny from all
</Files>


/public_html/u3auwa.org/doc/.htaccess - this one contained htaccess.txt which had the #Sub-dir e.g: /cmsms
RewriteBase / you mentioned; I added /u3auwa.org/ but it made no difference.

I am still unable to see the background image.

Thanks
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Background image not appearing

Post by jasnick »

Further to my last post, have now got the page almost OK. I had no trouble with the other images on the page but still cannot see the background image. I didn't need to make any path changes to see the other images.

One strange thing - if I use Web Developer to edit the CSS, the background image is visible!

Also, how do I get rid of the .Home that is showing under the nav?

Thanks
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: Background image not appearing

Post by M@rtijn »

Just hardcode the link in your css file to the full url:

Code: Select all

#container {
background: #fff url('http://westwebtest.com/u3auwa.org/uploads/images/bluebg3.jpg') top left repeat-y;
}
The only htaccess you'd have to edit is the one in your root or '/public_html'.
Copy the contents of the file in 'doc' (it's an example), to the one in your root.

Don't add '/u3auwa.org/', but use that instead of '/cms', like this:

Code: Select all

#Sub-dir e.g: /u3auwa.org
(no trailing slash)
Make your community a better place!
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am

Re: Background image not appearing

Post by jasnick »

Thanks M@rtijn - can now see the image. I imagine when the site is finished and I transfer everything over I will get rid of the extra path details that are necessary now.

Thanks again!
Post Reply

Return to “Layout and Design (CSS & HTML)”