Header issue - diff header on each page

Permalink
Our headers on our website is different on each page. Before the upgrade, it was working properly.

The way I had it when the site went up was perfect and very simple - I may have added a line of code in the header PHP file and then in concrete 5 under each page if you go to the page properties and then attributes, you can easily select which background image to use and that would repeat the image at the top of that page... Somewhere along the way when there was an upgrade or whatever this feature was lost.

Can anyone help? Our client is very unhappy that this just stopped working. THANKS!!!

 
adajad replied on at Permalink Reply
adajad
So what you have done, is this (and correct me if I'm wrong):

You have created a page attribute of type image/file
In your theme you call for the attribute on each page showing the file

But it isn't working anymore?

Could you supply your header.php and your page attribute settings?
mariesa replied on at Permalink Reply 2 Attachments
Attached is the header.php file the main.css document and a screenshot of the Page Properties settings. At the bottom you can see the option for selecting the specific background image for the page. Does this help at all? Thanks so much!

Header.php
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="<?php echo LANGUAGE?>" xmlns="http://www.w3.org/1999/xhtml">
<head>

<!-- Site Header Content //-->
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" />

<?php
$bg_img = $c->getAttribute('background_image');
$bg_img_src = @$bg_img->getRelativePath();
?>
<style type="text/css">
body {
background-image: url(<?php echo $bg_img_src; ?>);
}
</style>

<?php Loader::element('header_required'); ?>

</head>
<body>



<div id="page">

<div id="headerSpacer"></div>
<div id="header">

<?php if ($c->isEditMode()) { ?>
<div style="min-height: 80px">
<?php } ?>

<div id="headerNav">
<?php
$a = new Area('Header Nav');
$a->display($c);
?>
</div>


<?php
// we use the "is edit mode" check because, in edit mode, the bottom of the area overlaps the item below it, because
// we're using absolute positioning. So in edit mode we add a bit of space so everything looks nice.
?>

<div class="spacer"></div>

<?php if ($c->isEditMode()) { ?>
</div>
<?php } ?>

<div id="header-area">
<div class="divider"></div>
<div id="header-area-inside">
<?php
$ah = new Area('Header');
$ah->display($c);
?>
</div>

<?php if ($ah->getTotalBlocksInArea() > 0) { ?>
<div class="divider"></div>
<?php } ?>
</div>
</div>
adajad replied on at Permalink Reply
adajad
Try this in header.php instead
<?php
$bg_img = $c->getAttribute('background_image');
$bg_img_src = $bg_img->getRelativePath();
?>


or (for full path)
<?php
$bg_img = $c->getAttribute('background_image');
$bg_img_src = $bg_img->getURL();
?>


The above assumes the attribute handle for your background image is 'background_image'.

EDIT: It just hit me you said it stopped working after upgrade. Did you upgrade from 5.5 to 5.6? If so you might need to check your file manager permissions ( /index.php/dashboard/system/permissions/files/ ) and make sure Guest can 'View Files'.
mariesa replied on at Permalink Reply
Thank you!! I will try that. Appreciate your help. MR

Mariesa Ryan
c | 612.532.0795