1. New arrivals >>> "Awesome" JA Social Preview! - "Awesome" JAT3 Videos 06 videos!

+ Reply to Thread
 
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Apr 2006
    Posts
    9
    Points
    57.50
    Downloads
    43
    Uploads
    0
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please login to vote

    How to adjust width of bottom positions (user1, user2, top, user5)?

    I have a problem with the bottom positions - user1, user2, top, user 5 - in JA Purity: the template should allocate even width for these positions depending on how many are published, but I always end up with user1 at 22%.

    Example: user 1 and user 2 published, user1 is 22% and user2 is 77%. They should both be at 49% or something like that, that is, even width.

    I believe the code for this is in ja_templatetools.php (at the template's root folder), but I don't know how to change/debug it.

    Help is much appreciated.

    Thanks,

  2. #2
    Member isgroup's Avatar
    Join Date
    Feb 2009
    Location
    INDIA
    Posts
    70
    Points
    774.60
    Downloads
    235
    Uploads
    0
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Please login to vote
    get FIREBUG for Firefox browser and then just analysew,where is the file or CSS codes located,..
    It will be at templares_css.css ,i guess..
    Then just measure the width of how much you need for each module and change it accordingly in the CSS.
    Thats it..
    Let me know,if it dint solve your problem..
    Thanks

  3. #3
    Junior Member
    Join Date
    Apr 2006
    Posts
    9
    Points
    57.50
    Downloads
    43
    Uploads
    0
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please login to vote
    This is the code in index.php calling the positions:

    Code:
    <?php
            $spotlight = array ('user1','user2','top','user5');
            $botsl = $tmpTools->calSpotlight ($spotlight,99,22);
            if( $botsl ) :
            ?>
            <!-- BEGIN: CONTENT BOTTOM -->
            <div id="ja-botslwrap">
                <div id="ja-botsl" class="clearfix">
            
                  <?php if( $this->countModules('user1') ): ?>
                  <div class="ja-box<?php echo $botsl['user1']['class']; ?>" style="width: <?php echo $botsl['user1']['width']; ?>;">
                        <jdoc:include type="modules" name="user1" style="xhtml" />
                  </div>
                  <?php endif; ?>
            
                  <?php if( $this->countModules('user2') ): ?>
                  <div class="ja-box<?php echo $botsl['user2']['class']; ?>" style="width: <?php echo $botsl['user2']['width']; ?>;">
                        <jdoc:include type="modules" name="user2" style="xhtml" />
                  </div>
                  <?php endif; ?>
            
                  <?php if( $this->countModules('top') ): ?>
                  <div class="ja-box<?php echo $botsl['top']['class']; ?>" style="width: <?php echo $botsl['top']['width']; ?>;">
                        <jdoc:include type="modules" name="top" style="xhtml" />
                  </div>
                  <?php endif; ?>
            
                  <?php if( $this->countModules('user5') ): ?>
                  <div class="ja-box<?php echo $botsl['user5']['class']; ?>" style="width: <?php echo $botsl['user5']['width']; ?>;">
                        <jdoc:include type="modules" name="user5" style="xhtml" />
                  </div>
                  <?php endif; ?>
            
                </div>
            </div>
            <!-- END: CONTENT BOTTOM -->
            <?php endif; ?>
    These are all ja-box-something classes defined in template_css.css:

    Code:
    .ja-box-full, .ja-box-left, .ja-box-center, .ja-box-right {
    	float: left;
    	overflow: hidden;	
    }
    
    .ja-box-left div.moduletable,
    .ja-box-full div.moduletable {
    	padding-right: 30px;
    	background: none;
    }
    
    .ja-box-right div.moduletable {
    	padding-left: 30px;
    	/*background: url(../images/vdot2.gif) repeat-y left;*/
    }
    
    .ja-box-center div.moduletable {
    	padding: 0 30px;
    	/*background: url(../images/vdot2.gif) repeat-y left;*/
    }
    Finally, this is the code in ja_templatetools.php:

    Code:
    function calSpotlight ($spotlight, $totalwidth=100, $firstwidth=0) {
    
    		/********************************************
    		$spotlight = array ('position1', 'position2',...)
    		*********************************************/
    		$modules = array();
    		$modules_s = array();
    		foreach ($spotlight as $position) {
    			if( $this->_tpl->countModules ($position) ){
    				$modules_s[] = $position;
    			}
    			$modules[$position] = array('class'=>'-full', 'width'=>$totalwidth);
    		}
    
    		if (!count($modules_s)) return null;
    
    		if ($firstwidth) {
    			if (count($modules_s) > 1) {
    				$width = round(($totalwidth-$firstwidth)/(count($modules_s)-1),1) . "%";
    				$firstwidth = $firstwidth . "%";
    			}else{
    				$firstwidth = $totalwidth . "%";
    			}
    		}else{
    			$width = round($totalwidth/(count($modules_s)),1) . "%";
    			$firstwidth = $width;
    		}
    
    		if (count ($modules_s) > 1){
    			$modules[$modules_s[0]]['class'] = "-left";
    			$modules[$modules_s[0]]['width'] = $firstwidth;
    			$modules[$modules_s[count ($modules_s) - 1]]['class'] = "-right";
    			$modules[$modules_s[count ($modules_s) - 1]]['width'] = $width;
    			for ($i=1; $i<count ($modules_s) - 1; $i++){
    				$modules[$modules_s[$i]]['class'] = "-center";
    				$modules[$modules_s[$i]]['width'] = $width;
    			}
    		}
    		return $modules;
    	}
    So, in summary, it's not a CSS thing, it's something in this code.
    Any ideas?

  4. #4
    Junior Member
    Join Date
    Apr 2006
    Posts
    9
    Points
    57.50
    Downloads
    43
    Uploads
    0
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Please login to vote

    Solved Fond a solution

    I found the solution:

    1. Open "index.php" file on Purity's root folder.
    2. Look for this line:

    Code:
    $botsl = $tmpTools->calSpotlight ($spotlight,99,22);
    3. Just delete ",22" to make the template calculate your bottom positions width giving all modules the same width, or change the number to whatever you feel it's right for your module published in user1.

    Hope this helps someone.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts