VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: imageinaction on August 23, 2012, 19:22:31 PM

Title: Background image dissapears when Virtumart pages are opened
Post by: imageinaction on August 23, 2012, 19:22:31 PM
Hi

I have created an image for the background on my Joomla 2.5 website that works fine until a Virtumart page is opened. It looks as though a white background covers the original image ... Any ideas what this is or how I can correct the problem??
Title: Re: Background image dissapears when Virtumart pages are opened
Post by: ivus on August 24, 2012, 11:36:14 AM
Hi imageinaction,

Link available?

The answer to you question can be answered with another question...

QuoteHow long is a piece of string?

Seriously are you expecting us to know how you've built your site? how it's coded? what styles have been applied?
Help us to help you.
Title: Re: Background image dissapears when Virtumart pages are opened
Post by: imageinaction on August 24, 2012, 15:09:45 PM
Good point!!!

Currently working with VM2.0.8 on Joomla 2.5.6 PHP 5.3.13. I used Beez20 as the raw template, I amended the CSS to style to pages the way I need them and I added an image to the background. The image I added is in the body tag in the source code for index.php page, the code looks like this:

body {
   background-image: url(../../images/top.jpg);
   background-repeat: repeat-x;
}

It is this image that disappears when I select any Virtumart page ... I have just noticed the Beez20 'default' font re-size item also disappears.

Does this help??
Title: Re: Background image dissapears when Virtumart pages are opened
Post by: ivus on August 24, 2012, 15:17:42 PM
Hi imageinaction,

Firstly you should use Firebug/Inspector to find out the reason your images are disappearing. It will say "Failed to load resource" and then give you a path that it cannot find. Usually it's to do with the path... because the site generates dynamic routing, this sometimes screws up with the relative paths.

To combat this... I always (and I mean always) especially with dynamic, CMS driven sites, use absolute paths.

YOUR CURRENT CODE:

body {
   background-image: url(../../images/top.jpg);
   background-repeat: repeat-x;
}


WHAT MINE WOULD LOOK LIKE:

body {
   background-image: url(/images/top.jpg);
   background-repeat: repeat-x;
}


This method means that the images are pulled from an exact starting point location. The root folder, and then work it's way inwards.

Your method starts from the current location and drops out 2 folders and then expects the images folder to exists there.

Absolute paths to images means you will NEVER lose your images again.

I hope this helps ;D
Title: Re: Background image dissapears when Virtumart pages are opened
Post by: imageinaction on August 24, 2012, 15:49:19 PM
You star ... that worked  ;)