In response to a request, here is a method to have a different background for each individual ez-page. The example will be for the whole page below the header, but can easily be adapted to any other location by changing the stylesheet selectors (no PHP code moving required).
Edit /includes/templates/your_template/common/tpl_main_page.php (copy it from /includes/templates/template_default/common/tpl_main_page.php if you don't have a custom copy already.)
Find this section near the top:
PHP Code:
$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
and change it to
PHP Code:
$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<?php //Smart Backgrounds
$smart_image = '';
if ($current_page_base == 'index' or $current_page_base == 'product_info') { //add _ and top cat id to bg filename only if cat bg image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartbg_' . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]) . '.gif'))?'_' . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]):'';
} elseif ($current_page_base == 'page') { //add _page and ez-page id to bg filename only if cat bg image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartbg_page' . $_GET[id] . '.gif'))?'_page' . $_GET[id]:'';
} else { //add _ and page base to bg filename only if page bg image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartbg_' . $current_page_base . '.gif'))?'_' . $current_page_base:''; //default/home page class will be just .smartBG, and filename smartbg.gif
}// /Smart Backgrounds?>
<body id="<?php echo $body_id . 'Body'; ?>" class="smartBG<?php echo $smart_image;?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
Add to your stylesheet
Code:
.smartBG_page5 #contentMainWrapper {
background-image: url(../images/smartbg_page5.gif);
}
Repeat and change the page number for each ez-page id you want to give a unique background.
To put the individual background only in the center column, use this
Code:
.smartBG_page5 .centerColumn {
background-image: url(../images/smartbg_page5.gif);
}
This can be applied to any other element by using the proper class/id in the same manner.
Bookmarks