Viewing 15 posts - 16 through 30 (of 41 total)
  • Author
    Posts
  • jaybrd1 Friend
    #323997

    In your layouts folder, there is a line built in that you can adjust the width of the right column.
    For an example, I am using left-main-right.round.php
    On line 34 you will find:
    <blockquote>//$this->customwidth(‘right1’, 25); <== override right1 column width to 25%. Must call before call definePosition. Can call many time to override many columns.
    </blockquote>
    With this line you can change the default %, and it would look like this:
    <blockquote>$this->customwidth(‘right1’, 28); //<== override right1 column width to 25%. Must call before call definePosition. Can call many time to override many columns.
    </blockquote>

    You can change it to any % you want, as you can see I used 28%.

    What I would like, it a way to adjust it to a specific px.

    http://www.mdkconline.com/mdkc/

    larenz Friend
    #324003

    I had read that line but never tryied it before. Something like that I´m looking, maybe this help me. Anyway we keep trying to find a way to adjust to a specific px, but surely your answer is a good one.

    Is anyone have useful links just post them.

    P.D: By the way is anyboyd know how to create a new layout please help me. I opened a new thread because I´m trying but don´t get it…. http://www.joomlart.com/forums/topic/creating-new-layout-is-not-possible/

    status101 Friend
    #324096

    This is not really a help to those of you looking to set a px width for your left/right cols… and I really only discovered this by general logic.. I’m no php wiz by any stretch so prob can’t help any more but…..

    I tried changing different specific css with no luck.. I think this is because of the overall framework in that everything is elastic/calculated from the base css template width class in layout.css (.main … in my case 980px)… Everything else is calculated around that by /libs/ja.template.helper.php

    If you look at /layouts/default.php near the top, there is a line: $this->_basewidth = 20;

    This is the base numeric width value that is passed through the /libs/ja.template.helper.php to calculate the overall ‘width’ structure of the layout.

    This is then implemented in left.php and right.php ( eg: style=”width:<?php echo $r ?>%” – for the right col )

    So.. 20 means you have a 20% left and right based on an overall 980px .. If you collapse the left col then the right col stays at 20% and the main content expands. If you want a 30% left and right cols then just change the basewidth to 30. In many ways this is really nice but was painful to find. I ended up searching the files for the value “20” 🙂

    That got me the results I needed for now and as I am using a fixed 980px width I have stuck with % for the left and right cols because I can best guess it… but but in thinking it through a little ( because I have a presentation tomorrow and don’t have time to play… ) as the basewidth is a numeric only value.. if you changes the “%” in — style=”width:<?php echo $r ?>%” type lines in left.php, right.php, and main.php to “px” … the the helper ??should?? calculate based on the numeric values you set as a basewidth.

    A little bit further thinking ( and I have NO idea how to do this) if you where to find where the basewidth is passed to the left and right width variables, you could change one of them by adding or subtracting to the numeric value in /libs/ja.template.helper.php to have dissimilar column widths if you wanted that.

    Anyway, this is just my thinking and I hope it helps someone.

    korb Friend
    #324103

    Hi regarding this again,

    I am not using fluid, auto, or another autocalculated width layout… I know about ja_template-helper.js file, and I know about base width of 20%.

    I think my idea is pretty better than any other, I will try to explain a litle why.

    Perhaps you know there is a new resolution for wide LCD screens 1920×1200, and you have a percent based width calculation? OK further you have some ads in the right module position… wouldn’t they look bad on that 1920×1200 screeen resolution for a 97% (click here http://templates.joomlart.com/ja_purity_ii/ and chose full screen template setting, and look into the right position ads…).

    Now, further more, you see those images in the demo articles? If you set narrow screen setting, those images will overflow the right position, now wouldn’t be bettter to have a minimum width pixel based, to stop that happening?

    Another problem with width: you are in fullscreen setting, if you exagerately minimise the width of your browser, you will see that everything is compressed to be shown into that browser window, and the layout is terrible…. Isn’t there a better to have a minimum width in pixels for fullscreen setting?

    So the actual fixed width template setting is incomplete from my point of view. It should allow me to use a custom width for left, main and right positions.

    Next are fluid and fullscreen (auto) settings, man here there is a lot of work to do and simplify the js code from base width% to widthpx value, and the result is that only one column will have calculated width based on the other 2.

    Example: calculate main width based on fixed right and left values. Basically the code could look like this:

    left=custom_value
    right=custom_value
    if empty right and empty left => main widh=988px the width you specify for your .main class
    if empty right => main_width = 988px-right
    if empty left => main_width=988-left.
    if not empty left and not empty right main_width = 988-(left+right)

    SO what I mean is, again, calculate ONE column based on the specified width of the template, and specified values for left and/or right and/or main.

    I hope I gave you a sparcle of my idea, because what I want to do is easy and could help a lot and more important could help you customise your website layout to look unique and not standard Purity II default percent values.

    Danny

    brunus Friend
    #324696

    While in fixed size, ex 980px, It’s possible to assigne pixel sizes to left column, main content and right column.
    It’s about to edit the block you need (left-main-right.square for exemple), to un-comment and tune the right column %Size, and after ths to edit layout/main.php and layout/right.php to replace calculated % by fixed pixel sizes.

    It’s the trick use on my local dev site…but I’m not sure it’s the better way to do it.

    korb Friend
    #324829

    I figured out how to use a fix width in px for left and a fluid auto width for main block.

    Go to left.php block and edit style to style=”width:widthpx; float left” delete or comment the class.

    now open main.php block and set a new style=”oferflow:hidden” again delete any style and class.

    See what is happening :).
    Danny

    I will come back with some additions soon.

    musicinme Friend
    #324839

    <em>@basskool 154455 wrote:</em><blockquote>
    Go to left.php block and edit style to style=”width:widthpx; float left” delete or comment the class.
    </blockquote>

    Edit, comment or delete? So what choose? And where is this “style”?

    korb Friend
    #324844

    <em>@musicinme 154468 wrote:</em><blockquote>Edit, comment or delete? So what choose? And where is this “style”?</blockquote>

    This code in file left.php, line 2


    <div id="ja-left" class="column sidebar" style="width:<?php echo $l ?>%">

    If you have a class, delete the class name
    example


    <div class="class-name">
    or
    <div class="column sidebar"> - in our example

    make it

    <div class="">

    or delete entyre class if you want.

    I’ve notived that trying to comment the class name does nothing than renaming it.

    for instance

    class=”/*classname*/”

    this is what your firebug will show up in frontend. So dont try that, delete it like I just wrote a few lines up.

    Danny

    musicinme Friend
    #325010

    <em>@basskool 154455 wrote:</em><blockquote>

    Go to left.php block and edit style to style=”width:widthpx; float left” delete or comment the class.

    now open main.php block and set a new style=”oferflow:hidden” again delete any style and class.
    .</blockquote>

    Hi Danny.

    Thx for reply. I’m trying get it, and I’m a little cofused. Do you think about 1st two lines in left.php

    <!-- CONTENT -->
    <?php if (($l = $this->getColumnWidth('l'))): ?>
    <!-- LEFT COLUMN-->
    <div id="ja-left" class="" style="width:<?php echo $l ?>%">

    or should I delete every class included in this block?

    And about main.php, where to put this style?

    <!-- CONTENT -->
    <div id="ja-main" style="width:<?php echo $this->getColumnWidth('m') ?>%">
    <div class="">

    korb Friend
    #325011

    <em>@musicinme 154677 wrote:</em><blockquote>Hi Danny.

    Thx for reply. I’m trying get it, and I’m a little cofused. Do you think about 1st two lines in left.php

    <!-- CONTENT -->
    <?php if (($l = $this->getColumnWidth('l'))): ?>
    <!-- LEFT COLUMN-->
    <div id="ja-left" class="" style="width:<?php echo $l ?>%">

    or should I delete every class included in this block?

    And about main.php, where to put this style?

    <!-- CONTENT -->
    <div id="ja-main" style="width:<?php echo $this->getColumnWidth('m') ?>%">
    <div class="">

    </blockquote>
    Hi,
    Sorry my friend for being incorrect, this is the line from left.php, delete the class only for this div, the main div for left. You might need left1or left2 classes. Donno.


    <div id="ja-left" class="" style="width:<?php echo $l ?>%">

    Same for main.php, edit this line only:


    <div id="ja-main" style="width:<?php echo $this->getColumnWidth('m') ?>%">

    You might get layout breaks for deleting classes for internal divs.

    Regards,
    Danny

    marrean Friend
    #325047

    Can anybody from Joomlart team explain how to set up columns width in Purity II Template.
    There is no userguide about it. !!!!
    >:(

    I want set up colums to 180px-600px-230px (left-center-right) . Please help. !!!

    korb Friend
    #325074

    I am trying my best to help you also. Supose you are using default.php layout:

    open layouts/blocks/left.php

    find around line 3


    <div id="ja-left" class="column sidebar" style="width:<?php echo $l ?>%">

    replace with


    <div id="ja-left" class="column sidebar" style="width:180px;">

    Now open layouts/blocks/main.php around line 2 find


    <div id="ja-main" style="width:<?php echo $this->getColumnWidth('m') ?>%">

    replace with


    <div id="ja-main" style="width:600px;">

    Finally open layouts/blocks/right.php around line 3
    find


    <div id="ja-right" class="column sidebar" style="width:<?php echo $r ?>%">

    replace with


    <div id="ja-right" class="column sidebar" style="width:230px;">

    Regards,
    Danny

    biborico Friend
    #325420

    Just wanted to let you know, I’ve found a way to shrink right column totally if no module is associated with.

    We needed this to use 3 column layout on some pages and a 2 column layout on other pages.

    I can drop the code here if anyone is interested.

    bibo

    investx Friend
    #325645

    If you want to modify your columns width in pixels you must modify this :

    1. In the layouts file ( for example default.php )

    Uncomment this line and change 25 with the dimension you want. ( for example 160)

    //$this->customwidth(‘right1’, 25); <== override right1 column width to 25%. Must call before call definePosition. Can call many time to override many columns.
    If you want modify left column also add :
    $this->customwidth(‘left1’, 25);

    This will modify the right and left columns width.

    Also replace this line
    <div id=”ja-mainbody” style=”width:<?php echo $this->getColumnWidth(‘mw’) ?>%”>

    with this one

    <div id=”ja-mainbody” style=”width:<?php echo $this->getColumnWidth(‘mw’) ?>%;margin-right:<?php echo $this->getColumnWidth(‘r’) ?>px”>

    2. In the blocks file in main.php replace this line

    <div id=”ja-main” style=”width:<?php echo $this->getColumnWidth(‘m’) ?>%”>
    with this one
    <div id=”ja-main” style=”width:<?php echo $this->getColumnWidth(‘m’) ?>%;margin-left:<?php echo $this->getColumnWidth(‘l’) ?>px”>

    3. In the blocks file in right.php replace this line
    <div id=”ja-right” class=”column sidebar” style=”width:<?php echo $r ?>%”>
    with this one
    <div id=”ja-right” class=”column sidebar” style=”width:<?php echo $r ?>px;margin-left:-<?php echo $r ?>px”>

    4. In the blocks file in left.php replace this line
    <div id=”ja-left” class=”column sidebar” style=”width:<?php echo $l ?>%”>
    with this one
    <div id=”ja-left” class=”column sidebar” style=”width:<?php echo $l ?>px”>

    5. In libs file in ja.template.helper.php replace this lines:

    $this->_colwidth [‘l’] = ($l + $m)?round($l * 100 / ($l + $m)):0;
    if ($l) {
    $this->_colwidth [‘l1’] = round($l1 * 100 / $l);
    $this->_colwidth [‘l2’] = 100 – $this->_colwidth [‘l1’];
    }
    $this->_colwidth [‘m’] = 100 – $this->_colwidth [‘l’];

    with this ones :

    $this->_colwidth [‘l’] = $l;
    if ($l) {
    $this->_colwidth [‘l1’] = round($l1 * 100 / $l);
    $this->_colwidth [‘l2’] = 100 – $this->_colwidth [‘l1’];
    }

    6. In layout.css file add

    #ja-mainbody {
    float: left;
    width: auto;

    #ja-main {
    position: relative;
    width: auto;
    }
    #ja-left {
    position: absolute;
    float: left;
    }

    #ja-right {
    float: right;
    overflow: hidden;
    }

    See the result on http://www.investx.net

    brunus Friend
    #325738

    Thinks there is a very simple way to resize the columns in a layout.

    Choose a fixed size in pixel in the admin backend and in your layout file :

    $this->customwidth('right1', 33); // <== override right1 column width to 25%. Must call before call definePosition. Can call many time to override many columns.
    $this->customwidth('inset1', 15); // then add this for the left column, in your layout file, for exemple left-main-right_square

    But I have to focus your attention on my coworker suggestion a few post befor this one, to change the code to be able to display the content full size, using even the right column’s space when there is noting published in “right” positions.

Viewing 15 posts - 16 through 30 (of 41 total)

This topic contains 41 replies, has 18 voices, and was last updated by  barneytruit 13 years, 1 month ago.

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