Splitting Banner 2 to two equal sized modules

Change your online store into modern look with myStore eCommerce VirtueMart Joomla template - discussion forum.
GK User
Sun Jul 17, 2011 12:04 pm
Hi

I'd like to split the banner2 module into two equal sized modules. I figure i have to add a banner3 to the xml and then add the include to default.php in the blocks folder (at least i think it is) but its the code to make the modules equal sizes im unsure about, please see the image below.

Thanks

Image
User avatar
Gold Boarder

GK User
Mon Jul 18, 2011 11:05 am
Hi

Try something like this:

Open templateDetails.xml file and add "banner3" module position.
Code: Select all
<position>banner3</position>


Next open ../gk_mystore_dark/layouts/default.php

and find this lines:

Code: Select all
$this->definePosition ($positions);
$this->loadBlock('definitions');

?>


replace it with:
Code: Select all
$this->definePosition ($positions);
$this->loadBlock('definitions');

?>

<?php

   $b2_width = 100;
   $b3_width = 100;

   if($this->countModules('banner2 and banner3')) {
      $b2_width = 50;
      $b3_width = 49;
   }

?>


On same page find this code:

Code: Select all
<?php if( $this->countModules('banner2') ): ?>

      <div id="banner2" class="head clearfix">

         <jdoc:include type="modules" name="banner2" style="none" />

      </div>

      <?php endif; ?>


and replace it with

Code: Select all
<?php if($this->countModules('banner2 + banner3')) : ?>
            <div id="gk-banner" class="head clearfix">
            <?php if($this->countModules('banner2')): ?>
               <div class="gk-banner2" style="width:<?php echo $b2_width; ?>%;">
                  <jdoc:include type="modules" name="banner2" style="none" />
            </div>
            <?php endif; ?>
   
            <?php if($this->countModules('banner3')): ?>
               <div class="gk-banner3" style="width:<?php echo $b3_width; ?>%;">
               <jdoc:include type="modules" name="banner3" style="none" />
               </div>
            <?php endif; ?>
            </div>
      <?php endif; ?>


Finally open template.css file and add this line:
Code: Select all
#gk-banner div {display: inline-block}


That should work fine ;)

Cheers
User avatar
Platinum Boarder

GK User
Tue Jul 19, 2011 5:54 am
Perfect, thanks very much!!

Kev
User avatar
Gold Boarder


cron