Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • congeladosemcasa Friend
    #137915

    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,

    isgroup Friend
    #290201

    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 🙂

    congeladosemcasa Friend
    #290263

    This is the code in index.php calling the positions:


    <?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:


    .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:


    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]['class'] = "-right";
    $modules[$modules_s]['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?

    congeladosemcasa Friend
    #290289

    I found the solution:

    1. Open “index.php” file on Purity’s root folder.
    2. Look for this line:

    $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.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  congeladosemcasa 15 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum