Forum Support

Shape 5
March 29, 2024, 09:55:21 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: "top" module sizes  (Read 672 times)
Matt-K
Jr. Member
**
Offline Offline

Posts: 15



« on: February 21, 2010, 11:55:12 PM »

The way I'm looking to use the "top" module positions is the following:
- top_2 position will be for news article titles
- top_3 position will be for a 468x60 banner (which will run over top_4
- top_5 will be for a smaller banner ad

How can I adjust the width of each module? Logically thinking, these modules will not change sizes after we set them.

Thanks
Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #1 on: February 22, 2010, 08:39:49 AM »

Hello, they are set by percentages so you will have to do some guess and check to get the right sizes. If you edit index.php and find:


if ($this->countModules("top_2") && $this->countModules("top_3") && $this->countModules("top_4") && $this->countModules("top_5")) { $top_row="25%"; }
else if (!$this->countModules("top_2") && $this->countModules("top_3") && $this->countModules("top_4") && $this->countModules("top_5")) { $top_row="33.3%"; }
else if ($this->countModules("top_2") && !$this->countModules("top_3") && $this->countModules("top_4") && $this->countModules("top_5")) { $top_row="33.3%"; }
else if ($this->countModules("top_2") && $this->countModules("top_3") && !$this->countModules("top_4") && $this->countModules("top_5")) { $top_row="33.3%"; }
else if ($this->countModules("top_2") && $this->countModules("top_3") && $this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="33.3%"; }
else if (!$this->countModules("top_2") && !$this->countModules("top_3") && $this->countModules("top_4") && $this->countModules("top_5")) { $top_row="50%"; }
else if (!$this->countModules("top_2") && $this->countModules("top_3") && !$this->countModules("top_4") && $this->countModules("top_5")) { $top_row="50%"; }
else if (!$this->countModules("top_2") && $this->countModules("top_3") && $this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="50%"; }
else if ($this->countModules("top_2") && !$this->countModules("top_3") && !$this->countModules("top_4") && $this->countModules("top_5")) { $top_row="50%"; }
else if ($this->countModules("top_2") && !$this->countModules("top_3") && $this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="50%"; }
else if ($this->countModules("top_2") && $this->countModules("top_3") && !$this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="50%"; }
else if (!$this->countModules("top_2") && !$this->countModules("top_3") && !$this->countModules("top_4") && $this->countModules("top_5")) { $top_row="100%"; }
else if (!$this->countModules("top_2") && $this->countModules("top_3") && !$this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="100%"; }
else if (!$this->countModules("top_2") && !$this->countModules("top_3") && $this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="100%"; }
else if ($this->countModules("top_2") && !$this->countModules("top_3") && !$this->countModules("top_4") && !$this->countModules("top_5")) { $top_row="100%"; }


At the end of each row you'll need to adjust the top_row percentages.
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
Matt-K
Jr. Member
**
Offline Offline

Posts: 15



« Reply #2 on: February 22, 2010, 09:08:54 AM »

Thanks. I know about this part of the code but I don't know which one to change to give me the results I am looking to achieve. As I mentioned, 'top_2' would be a different size then 'top_3', 'top-4' and 'top_5'.

« Last Edit: February 22, 2010, 09:13:10 AM by mkoshko » Logged
valaniabj
Jr. Member
**
Offline Offline

Posts: 4



« Reply #3 on: February 24, 2010, 11:47:28 PM »

I am curious about this as well.  I want the top_2 position to be 60% width and the top_3 position to be 40% width.  Tried to update the code by adding:

else if ($this->countModules("top_2") && $this->countModules("top_3") && !$this->countModules("top_4") && !$this->countModules("top_5")) { $top_2="60%"; }
else if ($this->countModules("top_2") && $this->countModules("top_3") && !$this->countModules("top_4") && !$this->countModules("top_5")) { $top_3="40%"; }

and I get the top_2 on one position and the top_3 directly below it.  they are both left justified. 

what is the best way to split the top_2 and top_3 positions?

Please advise

Thanks
Brian
Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #4 on: February 25, 2010, 09:48:02 AM »

Hello, actually the easier way may be to just hard code the %s in. Look for the following in the index.php file:


            <?php if ($this->countModules("top_2")) { ?>
               <div id="s5_top_2" style="width:<?php echo $top_row ?>">
                  <jdoc:include type="modules" name="top_2" style="round_box" />
               </div>
            <?php } ?>
            
            <?php if ($this->countModules("top_3")) { ?>
               <div id="s5_top_3" style="width:<?php echo $top_row ?>">
                  <jdoc:include type="modules" name="top_3" style="round_box" />
               </div>
            <?php } ?>
            
            <?php if ($this->countModules("top_4")) { ?>
               <div id="s5_top_4" style="width:<?php echo $top_row ?>">
                  <jdoc:include type="modules" name="top_4" style="round_box" />
               </div>
            <?php } ?>
            
            <?php if ($this->countModules("top_5")) { ?>
               <div id="s5_top_5" style="width:<?php echo $top_row ?>">
                  <jdoc:include type="modules" name="top_5" style="round_box" />
               </div>
            <?php } ?>






In each section you will see style="width:<?php echo $top_row ?>". This echos the width into each section. You can change that to: style="width:30%". You can use any number in there and use a different % for each div.
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.