trouble with different background on other pages

Permalink
Hi im using the following code in Custom Attributes but not working. works before converting it to C5.

style>html {

margin:0px;
background-image: url(coffs-harbour-physiotherapist/bg1.jpg);
background-repeat: repeat-x;
}

</style>

If anyone could help it would be much appreciated!

johnkidd
 
mhawke replied on at Permalink Reply
mhawke
Is there a live URL we could look at?
johnkidd replied on at Permalink Reply
johnkidd
mhawke replied on at Permalink Reply
mhawke
It appears that the styling you are adding through the 'Add Header Content' is targeting the < HTML > tag but the main.css stylesheet is adding a background image to the < BODY > tag so you won't see the HTML background even if the paths to the 'staff.jpg' image was correct (which it isn't).

You need to make sure the path to your 'staff.jpg' image is an actual, real physical path on the server. "coffs-harbour-physiotherapists" is the name of the page but is not an actual directory on your server.

That's not how I would do this. I would create an 'image' page attribute called 'page_background' and add it to the page. Then I would add this to the BODY tag:
<body style="<?php if ($c->getCollectionAttributeValue('page_background')){?>background-image:url(<?php echo $c->getAttribute('page_background')->getVersion()->getRelativePath();?>)<?php } ?>">