Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • ashleyinspain Friend
    #188822

    Hi
    How do you change the widths of the sidebars
    I think I worked out how to change their postions but still have to try it out – create new layout file and change the span number and offset numbers – is that correct
    Best regards
    Ashley

    Ninja Lead Moderator
    #498692

    I’m afraid I’m not quite getting what you are mentioning above. It would be awesome if you can possibly include a screenshot and description on that particular screenshot on what you would like to do. Otherwise, it’s like solving a puzzle without clue.

    ashleyinspain Friend
    #498922

    Hi
    Here is a sreen print of the main content layout from one of the layouts in t3_blank template

    1. I would like to be able to put a module position in a module block above the component block and it to be the same width as the component block. Like the mast-col above the sidebars. It could be called main-top.
    2. It would be good to have a block below the component block as well, it could be called main-bottom
    3. What is the “message” block for? Is it for reporting error messages, if so I would rather have it at the top of the website can it be moved or a new block created and put at the top?
    4. How do you change the widths of the sidebars?
    5. It would be great if the main body layout had all these positions by default and we could control the widths of the sidebars and their positions with a widget the same as used for the spotlight positions
    I hope this is a clearer explanation
    Best regards
    Ashley


    1. Main-Content-Layout
    Ninja Lead Moderator
    #498975

    Hi Ashley

    There are user guide and video about T3 framework

    http://t3-framework.org/documentation/layout-system.html

    http://www.youtube.com/watch?v=fZT9YjskiM4&feature=player_embedded#at=45

    Hope it helps you to know more about T3 framework.

    Regards

    ashleyinspain Friend
    #500968

    Hi Ninja
    You answered questions 1 & 2 or pointed me in the direction of the instructions, I now know how to add module positions many thanks

    But I still don’t get how to change the widths of the main content and sidebars, my question 4 above

    I have found the layout configuration in the main body block files but don’t quite follow them, see screen prints

    The first one which is from mainbody.php with layout sidebar1-maincontent-sidebar2 has three columns of settings

    and the second which is from mainbody-content-left.php with layout maincontent-sidebar1-sidebar2 has four columns how does this work

    I did try editing the the files changing the span numbers from 6 to 8 and 3 to 2 keeping the totals as 12, but the layout got all messed up

    It would be great if the positions and layout could be controlled in a similar way to the spotlight module blocks

    I hope I have made myself clearer and you are able to give me some help

    Best regards

    Ashley


    1. t3-Main-Content-Configuration-sidebar1-content-sidebar2
    2. t3-Main-Content-Configuration-content-sidebar1-sidebar2
    Ninja Lead Moderator
    #501036

    Hope my below solution will help to create position for a module block above the component

    + Open templates/t3_blank/tpls/default.php file

    <blockquote>
    <body>

    <?php $this->loadBlock (‘header’) ?>

    <?php $this->loadBlock (‘mainnav’) ?>

    <?php $this->loadBlock (‘spotlight-1’) ?>

    <?php $this->loadBlock (‘mainbody’) ?>

    <?php $this->loadBlock (‘spotlight-2’) ?>

    <?php $this->loadBlock (‘navhelper’) ?>

    <?php $this->loadBlock (‘footer’) ?>

    </body>
    </blockquote>

    mainbody: block includes component and message, you can see it in templates/t3_blank/tpls/blocks/mainbody.php file

    You can define new block above mainbody by this way

    + Create new block in default.php file

    <blockquote>
    <body>

    <?php $this->loadBlock (‘header’) ?>

    <?php $this->loadBlock (‘mainnav’) ?>

    <?php $this->loadBlock (‘spotlight-1’) ?>

    <?php $this->loadBlock (‘new_block’) ?>

    <?php $this->loadBlock (‘mainbody’) ?>

    <?php $this->loadBlock (‘spotlight-2’) ?>

    <?php $this->loadBlock (‘navhelper’) ?>

    <?php $this->loadBlock (‘footer’) ?>

    </body>
    </blockquote>

    + Create templates/t3_blank/tpls/blocks/new_block.php file

    With content: new_block_1, new_block_2…


    <?php
    /**
    * @package T3 Blank
    * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
    * @license GNU General Public License version 2 or later; see LICENSE.txt
    */

    defined('_JEXEC') or die;
    ?>

    <?php if ($this->checkSpotlight('new_block_1', 'new_block_1, new_block_2')) : ?>
    <!-- New Block -->
    <div class="container new_block">
    <?php
    $this->spotlight ('new_block_1', 'new_block_1, new_block_2');
    ?>
    </div>
    <!-- //New Block -->
    <?php endif ?>

    ashleyinspain Friend
    #501068

    Hi Ninja
    Thanks for the run through re the extra mod positions, but I already have that covered

    My current problem is how to change the main body layout that is the content and sidebar widths please re-read my last post and screen prints

    Best regards

    Ashley

    Ninja Lead Moderator
    #501229

    When you change the config in templates/t3_blank/tpls/blocks/mainbody-content-left.php file you need to remove templates/t3_blank/etc/layout/default-content-left.ini file and your new changes in mainbody-content-left.php will affect and create new default-content-left.ini file

    I think you need to read user guide before my posted here. It will help you understand more then.

    ashleyinspain Friend
    #501804

    Hi Ninja

    I would like to really thank you for stopping by and spending your time trying to answer my questions, BUT
    Please take time to read and understand my questions, if you check above you are not answering the right ones

    To answer your last post I have both read the written guide dozens of times and watched the video guide umpteen times and can now recite them both

    BUT neither of them tell you how to change the sidebar widths or main content widths

    I have searched this forum and come up blank, so I tried searching Google to see if there was any other help out there

    I found this thread on the joomlart forums asking the same questions and making the same points I am

    The guys it that thread worked out how to change the widths the same way I did, by trial and error, but I was left unconfident I was doing it the correct way and still have doubts regarding the method

    Can you give some more explanation to this and how it works and the classes used ie spanfirst

    // Layout configuration
    $layout_config = json_decode ('{
    "two_sidebars": {
    "default" : [ "span8" , "span4" , "span2" , "span2" ],
    "wide" : [],
    "xtablet" : [ "span8" , "span4" , "span4" , "span4 spanfirst" ],
    "tablet" : [ "span12" , "span12 spanfirst" , "span6" , "span6" ]
    },
    "one_sidebar": {
    "default" : [ "span9" , "span3" , "span3" ],
    "wide" : [],
    "xtablet" : [ "span8" , "span4" , "span4" ],
    "tablet" : [ "span12" , "span12 spanfirst" , "span12" ]
    },
    "no_sidebar": {
    "default" : [ "span12" ]
    }
    }');

    I worked out that changes made to the these settings directly in the php files are not saved in the .ini file, only the changes made to the configuration in the layout tab in the template manager get saved in an .ini file of the same name as the layout .php file

    It would fantastic if it was made possible to make this “configurable” in the template manager like the spotlight blocks rather than only being “customizable” in the .php files

    See comments in the other thread link for their suggestions about this

    Best regards

    Ashley

    Wall Crasher Developer
    #501970

    Hi ashleyinspain,

    The sidebar’s span width and the component’s span width can not be changed via Layout tab in backend.
    Though it can be configurable by the code as you mentioned above.

    I will give you some details to understand to show that block work.

    $layout_config = json_decode ('{
    "two_sidebars": {
    "default" : [ "span8" , "span4" , "span2" , "span2" ],
    "wide" : [],
    "xtablet" : [ "span8" , "span4" , "span4" , "span4 spanfirst" ],
    "tablet" : [ "span12" , "span12 spanfirst" , "span6" , "span6" ]
    },
    "one_sidebar": {
    "default" : [ "span9" , "span3" , "span3" ],
    "wide" : [],
    "xtablet" : [ "span8" , "span4" , "span4" ],
    "tablet" : [ "span12" , "span12 spanfirst" , "span12" ]
    },
    "no_sidebar": {
    "default" : [ "span12" ]
    }
    }');

    You can image this is just look like a several nested if else condition.
    First, we create the markup block.

    <div id="t3-mainbody" class="container t3-mainbody">
    <div class="row">

    <!-- MAIN CONTENT -->
    <div id="t3-content" class="t3-content <?php echo $this->getClass($layout, $col) ?>" <?php echo $this->getData ($layout, $col++) ?>>
    <jdoc:include type="message" />
    <jdoc:include type="component" />
    </div>
    <!-- //MAIN CONTENT -->

    <?php if ($this->countModules($sidebar1)) : ?>
    <!-- SIDEBAR 1 -->
    <div class="t3-sidebar t3-sidebar-1 <?php echo $this->getClass($layout, $col) ?><?php $this->_c($sidebar1)?>" <?php echo $this->getData ($layout, $col++) ?>>
    <jdoc:include type="modules" name="<?php $this->_p($sidebar1) ?>" style="T3Xhtml" />
    </div>
    <!-- //SIDEBAR 1 -->
    <?php endif ?>

    <?php if ($this->countModules($sidebar2)) : ?>
    <!-- SIDEBAR 2 -->
    <div class="t3-sidebar t3-sidebar-2 <?php echo $this->getClass($layout, $col) ?><?php $this->_c($sidebar2)?>" <?php echo $this->getData ($layout, $col++) ?>>
    <jdoc:include type="modules" name="<?php $this->_p($sidebar2) ?>" style="T3Xhtml" />
    </div>
    <!-- //SIDEBAR 2 -->
    <?php endif ?>

    </div>
    </div>

    You will see the getClass function is call in order (component, mast-col, span1, span2). The $col is indicate this order.
    Now, look at the config line “default” : [ “span8” , “span4” , “span2” , “span2”]
    So it mean, the component will get span8, mast-col will get span4 and so on.

    Look at the config block $layout_config will have 3 sub configuration. These sub configuration will be determine by

    if ($this->countModules($mastcol) or $this->countModules("$sidebar1 and $sidebar2")) {
    $layout = "two_sidebars";
    } elseif ($this->countModules("$sidebar1 or $sidebar2")) {
    $layout = "one_sidebar";
    } else {
    $layout = "no_sidebar";
    }

    So now, for example, you want to add a position before (above) component block, you need to add the a new value in
    “default” : [ “span6”, “span8”, “span4”, “span2”, “span2”],

    <div id="t3-mainbody" class="container t3-mainbody">
    <div class="row">

    <?php if ($this->countModules($sidebar1)) : ?>
    <!-- NEW BLOCK -->
    <div class="new-class <?php echo $this->getClass($layout, $col) ?><?php $this->_c('new-position')?>" <?php echo $this->getData ($layout, $col++) ?>>
    <jdoc:include type="modules" name="<?php $this->_p('new-position') ?>" style="T3Xhtml" />
    </div>
    <!-- //NEW BLOCK -->
    <?php endif ?>
    ......

    Hope it helps,

    Regards

    ashleyinspain Friend
    #502708

    Hi Wall ! or should that be Will !
    Thanks for the detailed explanation,
    I will try out some changes and see how I go
    Best regards
    Ashley

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

This topic contains 11 replies, has 3 voices, and was last updated by  ashleyinspain 11 years, 3 months ago.

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