Background Image

Permalink
Hello,

I am building a website using the Elemental Theme. He has asked me to add a background image in the body. I don't remember any more how i did it, and i cannot find it, but it seems that i followed the instructions onhttps://www.concrete5.org/documentation/how-tos/designers/use-attrib... and now i have a background image that it is repeating to cover the whole body. I would like instead not to repeat and to stretch.

Which file should i edit? I found in a forum to use body {no-repeat } but i am not sure this is right. Can anyone suggest?

Thank you

vasileiosg
View Replies: View Best Answer
Steevb replied on at Permalink Reply
Steevb
Try:
<?php 
$backgroundImage = $c->getAttribute('background_image');
if ($backgroundImage) {
    $backgroundImageURL = $backgroundImage->getURL();
    echo '<style type="text/css">body {background-image:url(' . $backgroundImageURL . ');background: no-repeat fixed;background-size: cover}</style>';
}
?>
vasileiosg replied on at Permalink Reply
vasileiosg
Thank you! But on which file?
vasileiosg replied on at Permalink Reply
vasileiosg
I assumed that i need to put it in concrete/themes/elemental/elements/header.php before </header>

but it did not work.
vasileiosg replied on at Permalink Best Answer Reply
vasileiosg
Eventually i found the solution to be very simple. instead of adding it to the background, i added it to the layout using the concrete5 editor