New Module Positions for Game-Magazine

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Mon Nov 21, 2011 10:10 pm
Hi,

i want to create new module positions for game-magazine, because i think there is a lot of space which could be used e.g. for social network icons etc. so how can i do that? i know how it works with the positioning in css, but what exactly do i have to do... i already created a entry in the template.xml and the template.css...but what else? the module doesn't appear right now. i hope somebody can understand what i've planned so far :D sorry for bad english und thanks in advance..
User avatar
Senior Boarder

GK User
Tue Nov 22, 2011 12:01 am
doublepost sorry
User avatar
Senior Boarder

GK User
Tue Nov 22, 2011 1:40 am
Give me some idea of what you need, grab the modules position image and start making blocks re-post it here when your finished. I always hack the hell out of templates because I never know what a customer will want. Due to the flexibility of Gavern, anything is possible. this is a test site for THW2 it's all hacked up with about 60 extra modules.. done the right way http://8balla.com/0/
User avatar
Platinum Boarder

GK User
Tue Nov 22, 2011 11:04 am
i marked it on the screenshot of the game-magazine demo, because the positions i would like to have are above others... the social icons should be on the right of the menu -> because i don't want to add so many menu items and there's a lot of space unused and the seconds one should maybe show the amount of registered members or some other one line text. i know how to change a existing module position, but i never created a new one, so maybe you can help me with that, thanks :)
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 3:43 am
topa.zip

Step 1

go to {template}/lib/framework/gk.const.php You'll see a list of modules positions.. just paste this in where you can get it to fit between a present bank of module positions.

Code: Select all
   'topa1' => 'gk_style',
   'topa2' => 'gk_style',
   'topa3' => 'gk_style',
   'topa4' => 'gk_style',
   'topa5' => 'gk_style',
   'topa6' => 'gk_style',
   'topa7' => 'gk_style',
   'topa8' => 'gk_style',
   'topa9' => 'gk_style',
   'topa10' => 'gk_style',
   'topa11' => 'gk_style',
   'topa12' => 'gk_style',



close this file and upload.


Step 2

Open {template}/templateDetails.xml open this file and lets add:

Code: Select all
<!-- TOPA Module Positions -->
        <position>topa1</position>
        <position>topa2</position>
        <position>topa3</position>
        <position>topa4</position>
        <position>topa5</position>
        <position>topa6</position>
        <position>topa7</position>
        <position>topa8</position>
        <position>topa9</position>
        <position>topa10</position>
        <position>topa11</position>
        <position>topa12</position>


Just add these about mid page where you see other banks of modules. this will allow you to choose the module positions within the modules.


Step 3 Take this file that I uploaded and put it in {template}/layout/blocks/ now all these modules use topa as a prefix but you can make your own names but you'll have to change all the other variables to match.





Step 4 go to {template}/layouts/ and open default.php on or about line 99 you will see

Code: Select all
             </div>
             <?php endif; ?>


add right below that paste this and close

Code: Select all
<?php $this->loadBlock('topa'); ?>








Step 5 now we need a little CSS to control the modules. if left alone the 2 modules would be at 50% each but we want 70% & 30& (or whatever you need for your application, so use this css and modify as you need


assuming your going to use topa1 and topa2

#gkTopa1 { width: 70%!important; overflow: visible; margin-bottom: 0px; }
#gkTopa2 { width: 30%!important; overflow: visible; margin-bottom: 0px; }


PROBLEMS:

If one of the modules drops below the other just change the % for either module to give it a bit more room. The topa.php is already set for header CSS, if you need the white color background just holla back.

You now have 12 new module positions that you can do as you like, you can add more or drop that number if you choose.



If you have any problems don't hesitate to message me
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 6:49 am
wow thanks a lot! i will try this today :)
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 10:44 am
Nope thank Gavern, they did a damned good job with it.. if you want to thank me.. teach someone else something.
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 1:43 pm
as you can see in the attachment the module is displayed like a normal top position, but i think it's not independet from that top positions... i tried to move the position by css, but nothing happened.. i would like the module next to my menu, without leaving a space.. what i'm doing wrong? hope you can help me, thanks.
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 10:05 pm
you have
Code: Select all
<?php $this->loadBlock('topa'); ?>
in the wrong position.. it should be right under the menu so move it up in the default.php as show in your first images. if you need something for the footer thats a bit different css.
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 10:08 pm
.
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 10:18 pm
As a coder you should NEVER stop with trial and error as coding isn't a perfect science. some of the best things happened by accident. the code is exactly the same code I've used 7 Game Magzine sites over for customers.

here is the correct position

Code: Select all
             <?php if( $this->modules('header')) : ?>
             <div id="gkHeader" class="clear clearfix">
                <jdoc:include type="modules" name="header" style="<?php echo $this->module_styles['header']; ?>" />
                   
                 
             </div>
             <?php endif; ?>
                <?php $this->loadBlock('topa'); ?>
             <?php $this->messages('message-position-2'); ?>
             <?php $this->loadBlock('top'); ?>
             <?php $this->loadBlock('main'); ?>
             <?php $this->loadBlock('user'); ?>
          </div>
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 10:22 pm
i added that line after the menu entry before you answered and it was displayed under the menu, then i changed like you wrote and it's under the header position now - of course i also reduced the % to check, if it's too high
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 10:26 pm
perfect. now you have the option to use the header or use topa1 - topa8 to split the header position as you like, disabling any thing in the header positions of course.

I see your getting it, your going to be a great coder, show me the finished site when you get it done.
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 10:29 pm
what do you mean? i still want to use the header position, i just need some extra positions

no i don't get it and i'm the worst coder on planet earth :P i just can change code.. but new code -> no idea about that
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 10:32 pm
predata wrote:what do you mean? i still want to use the header position, i just need some extra positions



Bro what ever you want to do is perfectly fine. use your imagination it can never be wrong if it's right for you. I was under the impression you wanted it like the image you first posted.. you can unly do that by disabling the header position and using two of the new module positions
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 10:34 pm
well thats the first step, first you learn to change it.. then you remember what you changed... then you write what you changed some place else.. then your writing your own code.. the same with CSS. Your on your way and don't know it yet
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 10:38 pm
sure i still want to do it like in my screenshot, but what's about that slideshow etc in the header position? i don't want to lose these. before i started this thread i published this icon module on the searchfield position and moved it down, so it was shown above the menu line and it looks fine, but the problem about that was, that i still want to use that searchfield, so i needed new positions for that which i can move to any position i want, even above other module positions, i did this on other sites by changing positions i didn't need in the css to -> positon: absolute and moved it to the place i want it do be displayed, but this doesn't work with this template, because there is still the empty space from the position, even if the module is on a whole other position... i know this is confusing and maybe you don't understand my problem, because of my bad english, but hopefully you can still help me with that... sorry
User avatar
Senior Boarder

GK User
Wed Nov 23, 2011 10:44 pm
Well you have 2 new rows of modules to play with..

highlighter can go in topa1, social icons in topa2

Imageshow can go in topa8 @ 75%, a nsp with new news or whatever in topa9 @ 25%

just remember to change the css from topa1 & topa2 to topa8 & topa9
User avatar
Platinum Boarder

GK User
Wed Nov 23, 2011 11:11 pm
i tried some things... i think i know how to solve it another way, but i will use this positions for another idea i just got...
User avatar
Senior Boarder


cron