...adding 3 new mod positions to the template

GK User
Mon Sep 24, 2012 8:57 pm
I would like to add 3 new mod positions to the template...

I want to add a new mod position called highligher2 below header 1 & 2 ... and then I want to add a header3 & 4 below that same setup as header 1 & 2...

Please explain what I would need to edit to add these items... header mods would retain same styling as header 1 & ...likewise for the highlighter mod..

Thanks
Trey
User avatar
Expert Boarder

GK User
Mon Sep 24, 2012 9:36 pm
I editted the template details and added the positions... also editted following file's:

layouts > blocks > default.php

<body id="bd" class="fs<?php echo $this->getParam(GK_TOOL_FONT);?> <?php echo $this->browser();?>">
<?php if($this->isIE6() && $this->_tpl->params->get('ie6bar') == 1) : ?>
<div id="infobar"><a href="http://browsehappy.com"><?php echo JText::_('IE6_BAR'); ?></a></div>
<?php endif; ?>
<div id="bg-wrap">
<div id="bg-footer" class="main">
<!-- MAIN NAVIGATION -->
<?php $this->loadBlock('top') ?>

<div id="gk-wrapper-top" class="main">
<a name="Top" id="Top"></a>
<!-- NAV -->
<?php $this->loadBlock('nav'); ?>
</div>

<div id="gk-wrapper-content" class="main"<?php if($this->countModules('header1 + header2') == 0) echo ' style="padding-top:8px;"'; ?>>
<!-- HEADER -->
<?php $this->loadBlock('header'); ?>
<!-- TOP MODULES -->
<?php $this->loadBlock('topsl'); ?>
<?php if($this->checkComponent() || $this->checkMainbody() || $this->countModules($this->getPositionName('left1').' + '.$this->getPositionName('left2').' + '.$this->getPositionName('left-mass-top').' + '.$this->getPositionName('left-mass-bottom').' + '.$this->getPositionName('right1').' + '.$this->getPositionName('right2').' + '.$this->getPositionName('right-mass-top').' + '.$this->getPositionName('right-mass-bottom').' + '.$this->getPositionName('content-mass-top').' + '.$this->getPositionName('content-mass-bottom').' + '.$this->getPositionName('content-top').' + '.$this->getPositionName('content-bottom').' + '.$this->getPositionName('inset1').' + '.$this->getPositionName('inset2'))) : ?>
<div id="gk-wrapper-content" class="main"<?php if($this->countModules('header3 + header4') == 0) echo ' style="padding-top:8px;"'; ?>>
<!-- Highlighter2 -->
<?php $this->loadBlock('highlighter'); ?>
<!-- HEADER 3 & 4 -->
<?php $this->loadBlock('header'); ?>


<!-- MAIN CONTAINER -->
<div id="gk-container">
<div class="static clearfix">
<div id="gk-mainbody" style="width:<?php echo $this->getColumnWidth('mw') ?>%">
<?php $this->loadBlock('main') ?>
<?php $this->loadBlock('left') ?>
</div>
<?php $this->loadBlock('right') ?>
</div>
</div>
<?php endif; ?>
<!-- USER MODULES -->
<?php $this->loadBlock('usersl') ?>
</div>

<!-- BOTTOM MODULES -->
<?php $this->loadBlock('botsl') ?>
<!-- FOOTER -->
<?php $this->loadBlock('footer') ?>

<?php if($this->_tpl->params->get('t3_logo')) : ?>
<a href="http://wiki.joomlart.com/wiki/JA_Template_Framework/Overview" target="_blank" id="t3_logo">Powered by T3 Framework</a>
<?php endif; ?>
</div>
</div>
<!-- POPUPS -->
<?php $this->loadBlock('usertools/login'); ?>
<?php $this->loadBlock('usertools/register'); ?>
<jdoc:include type="modules" name="debug" />
</body>
</html>

layout> blocks > header.php

<?php

$wheader1 = $wheader2 = 100;

$wheader3 = $wheader4 = 100;

if($this->countModules('header1 && header2')){
$wheader1 = $this->getParam('header1_column');
$wheader2 = 100 - $this->getParam('header1_column');
}

if($this->countModules('header3 && header4')){
$wheader3 = $this->getParam('header3_column');
$wheader4 = 100 - $this->getParam('header3_column');
}


?>

<?php if( $this->countModules('banner1')) : ?>
<div id="banner1" class="clear clearfix">
<jdoc:include type="modules" name="banner1" style="gavickpro" />
</div>
<?php endif; ?>

<jdoc:include type="message" />

<?php if($this->countModules('header1 + header2')) : ?>
<div id="gk-header" class="normal clearfix clear">
<?php if($this->countModules('header1')) : ?>
<div id="gk-header1" style="width:<?php echo $wheader1; ?>%;">
<jdoc:include type="modules" name="header1" style="gavickpro" />
</div>
<?php endif; ?>

<?php if($this->countModules('header2')) : ?>
<div id="gk-header2" style="width:<?php echo $wheader2; ?>%;">
<?php if($this->countModules('header1 and header2')) : ?>
<div class="two-modules">
<?php endif; ?>
<jdoc:include type="modules" name="header2" style="gavickpro" />
<?php if($this->countModules('header1 and header2')) : ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>

<?php if($this->countModules('highlighter2')) : ?>
<div id="gk-top-highlighter2">
<jdoc:include type="modules" name="highlighter2" style="none" />
</div>
<?php endif; ?>


<?php if($this->countModules('header3 + header4')) : ?>
<div id="gk-header" class="normal clearfix clear">
<?php if($this->countModules('header3')) : ?>
<div id="gk-header3" style="width:<?php echo $wheader3; ?>%;">
<jdoc:include type="modules" name="header3" style="gavickpro" />
</div>
<?php endif; ?>

<?php if($this->countModules('header4')) : ?>
<div id="gk-header4" style="width:<?php echo $wheader4; ?>%;">
<?php if($this->countModules('header3 and header4')) : ?>
<div class="two-modules">
<?php endif; ?>
<jdoc:include type="modules" name="header4" style="gavickpro" />
<?php if($this->countModules('header3 and header4')) : ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>


<?php if( $this->countModules('banner2') ): ?>
<div id="banner2" class="clearfix clear">
<jdoc:include type="modules" name="banner2" style="none" />
</div>
<?php endif; ?>
User avatar
Expert Boarder

GK User
Tue Sep 25, 2012 3:48 pm
I setup a test site and uploaded the editted file's and this is what I am getting... looks like header4 is a little bit out of whack...

http://football.treybraids-designs.com/

.... what should I fix so header4 is next to header3 like header1 & 2?

Thanks
Tret
User avatar
Expert Boarder

Konrad M
Wed Sep 26, 2012 1:46 pm
Hi,
I checked in source and you have published module only in 'header1' position. Can you publish rest of them and let me know ?
User avatar

GK User
Wed Sep 26, 2012 2:20 pm
Konrad the Facebook Mod is in header3 and Subscribe and Welcome are in header4...

Thanks
Trey
User avatar
Expert Boarder

GK User
Fri Sep 28, 2012 1:13 pm
Konrad please let me know what else I need to change?

Thanks
Trey
User avatar
Expert Boarder

Konrad M
Fri Sep 28, 2012 2:38 pm
Please try go to templateDetails.xml and find
Code: Select all
<param name="header1_column" type="text" default="60" label="Header 1 width" description="" />

and add this after
Code: Select all
<param name="header3_column" type="text" default="60" label="Header 3 width" description="" />
User avatar

GK User
Fri Sep 28, 2012 3:20 pm
Konrad I added that to the template details and it did adjust the width of the header4 mods... they aren't side by side though like header 1 and 2--- any idea what I've done wrong?

Thanks
Trey
User avatar
Expert Boarder

GK User
Fri Sep 28, 2012 3:29 pm
Thanks I appreciate the help...forgot that I had to go back in the template.css and comment out the header3 and 4 positions...

Thanks
Trey

:D
User avatar
Expert Boarder

Konrad M
Fri Sep 28, 2012 3:31 pm
You have to add floating to both headers. So try add to template.css
Code: Select all
#gk-header3,
#gk-header4 {
float:left;
}
User avatar

GK User
Fri Sep 28, 2012 3:32 pm
Done and it looks great!!!

Thanks
Trey

I added this --just copied and pasted header1 and 2 css

/*i added header 3 and 4 */
#gk-header3 {
float: left;
background-color:#FFF;
}

#gk-header4 { float: right; }
.two-modules { margin-left: 18px; }
User avatar
Expert Boarder


cron