add a simple module position

GK User
Wed Feb 22, 2012 4:47 am
Hello hello !

I really love this template and i want to add a simple customisation. Just add a module position at the top of page (width 100% and position fixed) (i can do the css, but i don't know how to add a module position to the gavick template)

like http://gosugamers.net/ (login panel)

thanks ;D
User avatar
Fresh Boarder

GK User
Wed Feb 22, 2012 5:15 am
Example position name i have used is "customtop". You can use anything you like, just make sure you change name in other needed places.

1. Adding necessary php code.
Find File: \templates\gk_game_magazine\layouts\blocks\logo.php
Find Line: 23 which is empty line which is as below
Code: Select all
22 -?>
23 -
24 - <?php if ($this->getParam('logo_type', 'image')!=='none'): ?>

Add below code in line 23 in empty space.
Code: Select all
<?php if($this->modules('customtop')) : ?>
<div id="gkCustomtop">
   <jdoc:include type="modules" name="customtop" style="<?php echo $this->module_styles['customtop']; ?>" />
</div>
<?php endif; ?>

So you end up with following code
Code: Select all
?>
<?php if($this->modules('customtop')) : ?>
<div id="gkCustomtop">
   <jdoc:include type="modules" name="customtop" style="<?php echo $this->module_styles['customtop']; ?>" />
</div>
<?php endif; ?>
<?php if ($this->getParam('logo_type', 'image')!=='none'): ?>

2. Adding position in xml file.
Find File: \templates\gk_game_magazine\templateDetails.xml
Find Lines: 155 which is below
Code: Select all
        <position>tab10</position>

Add below code after above.
Code: Select all
        <!-- Custom Module Positions -->
        <position>customtop</position>


3. Adding position style in php code.
Find File: \templates\gk_game_magazine\lib\framework\gk.const.php
Find Lines: 77 to 79 which is below
Code: Select all
   'bottom11' => 'gk_style',
   'bottom12' => 'gk_style'
);

Replace with below
Code: Select all
   'bottom11' => 'gk_style',
   'bottom12' => 'gk_style',
   'customtop' => 'none'
);


4. Adding css class for our new custom div.
Enable Override: Template settings > Advanced settings > Css override "on"
Find File : \templates\gk_game_magazine\css\override.css
Add your custom css code such as
Code: Select all
#gkCustomtop { background:#fff; width: auto; }
#gkCustomtop { font-size: 12px; color: #000; }

Now create your module and position it to "customtop".

See you around...
User avatar
Platinum Boarder

GK User
Wed Feb 22, 2012 7:19 am
Hey normanUK !

So perfect ! Thanks a lot ! If I were rich I would send you a limo with champagne and girls ! but... so I just wrote this message :D

Thank you !
User avatar
Fresh Boarder

GK User
Wed Feb 22, 2012 7:40 am
I ll just wait until you become rich then ;) no problem at all, see you around...
User avatar
Platinum Boarder

GK User
Wed Feb 22, 2012 2:41 pm
I have a problem...

Image
(full size : http://data.imagup.com/12/1144583588.jpg)

my block is "position : fixed". And when I scroll, it's behind images and flash.

Thank you.
User avatar
Fresh Boarder

GK User
Wed Feb 22, 2012 2:54 pm
You can add z-index to your custom css...
Code: Select all
#gkCustomtop { background:#fff; width: auto; z-index: 10000000; }
User avatar
Platinum Boarder

GK User
Wed Feb 22, 2012 2:59 pm
Good job, i add a French cuisine to the prize pool !

Thank you again.
User avatar
Fresh Boarder

GK User
Wed Feb 22, 2012 3:05 pm
No problem at all.

See you around...
User avatar
Platinum Boarder


cron