Hi,
From your initial post, I thought that you wanted to update the background image for the whole site from one place in CMS Builder.
It sounds like instead, you want to change the background image for each event. This changes how things would be setup.
Since you need to get the record number for the event that is being displayed, having the background image URL in a separate CSS file won't work. Instead, you need to add this code into your events detail pages:
<style>
<?php foreach ($guided_toursRecord['images'] as $index => $upload): ?>
body {
background-image: url("<?php echo htmlencode($upload['urlPath']) ?>") !important;
}
<?php break; // only show one uploaded image ?>
<?php endforeach; ?>
</style>
This code will display the uploaded image URL to use for the background image and it uses the !important to take precedent over the default background image in your CSS file. You still need to have a background image in the CSS file so that if a background image isn't uploaded for an event, it will fall back on the background image set in the CSS file.
You won't need to run any PHP in your CSS file so it can be changed back to style.css and any PHP code removed.
Let me know how this works out for you.
Cheers,
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/