diffrent header bg on diffrent pages

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Dec 31, 2012 1:57 pm
Reply with quote
Report this post
Hi I want to have different header_bg on different pages rather than the same header_ bg on all pages across the site.

Ive created additional Image Show GK4 modules and edited what I want on them then assigned them to by menu.

In the template stylesheet I've added an addition css class and then added nobga to one of the Image Show GK4 modules under module suffix

#gkHeader.nobga {
background: transparent url('../images/header_bga.jpg') no-repeat center top;
/*min-height: 760px;*/
}


This isnt working the way I thought it would. I then looked at the php code and noticed this for file defailt.php

<?php if($this->API->modules('header')) : ?>
<section id="gkHeader"<?php if($header_nobg): ?> class="nobg"<?php endif; ?>>
<?php if(!$header_nobg): ?>
<div class="gkPage">
<?php endif; ?>
<jdoc:include type="modules" name="header" style="<?php echo $this->module_styles['header']; ?>" />
<?php if(!$header_nobg): ?>
</div>
<?php endif; ?>
</section>
<?php endif; ?>

I'm guessing this needs editing for me to achieve what I want to do?

Can you help
User avatar
Fresh Boarder

GK User
Wed Jan 02, 2013 10:24 am
Reply with quote
Report this post
Hi,

In the layouts/default.php file you will find a following fragment:

Code: Select all
// looking for the nobg suffix
foreach($header_modules as $mod) {
   $params = json_decode($mod->params);
   
   if(stripos($params->moduleclass_sfx, 'nobg') !== FALSE) {
      $header_nobg = true;
   }
}


Please replace it to:

Code: Select all
// looking for the nobg suffix
foreach($header_modules as $mod) {
   $params = json_decode($mod->params);
   
   if(stripos($params->moduleclass_sfx, 'nobg') !== FALSE) {
      $header_nobg = true;
   }
       
   if(stripos($params->moduleclass_sfx, 'nobga') !== FALSE) {
      $header_nobg = true;
   }
}
User avatar
Administrator

GK User
Wed Jan 02, 2013 2:43 pm
Reply with quote
Report this post
Hi dziudek

Thank you for your reply. I've made the following change but It still dosent work here is the link to the site under development http://www.essentialfitneesscamp.com/new
User avatar
Fresh Boarder

GK User
Wed Jan 02, 2013 10:21 pm
Reply with quote
Report this post
Now I see that I've forgot about one detail. Please find in the layouts/default.php file the following fragment:

Code: Select all
<?php if($header_nobg): ?> class="nobg"<?php endif; ?>


replace it to:

Code: Select all
<?php if($header_nobg): ?> class="<?php echo $header_nobg; ?>"<?php endif; ?>


and then replace the previous code to:

Code: Select all
// looking for the nobg suffix
foreach($header_modules as $mod) {
   $params = json_decode($mod->params);
   
   if(stripos($params->moduleclass_sfx, 'nobg') !== FALSE) {
      $header_nobg = 'nobg';
   }
       
   if(stripos($params->moduleclass_sfx, 'nobga') !== FALSE) {
      $header_nobg = 'nobga';
   }
}
User avatar
Administrator

GK User
Wed Jan 02, 2013 10:33 pm
Reply with quote
Report this post
dziudek

spot on thank you for your help
User avatar
Fresh Boarder


cron