Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • krumz Friend
    #196848

    Hello All,

    Hope what I’m saying below makes sense. :-[

    So it took me a while to figure out that the mast-col position will not show unless you have sidebar-1 or sidebar-2 selected. It is not explained anywhere about this in the documentation (at least not that I could find).

    This (to me) seems to lack functionality to what is otherwise a very good template. In my case, (I always use the content left layout) I have a couple of short pages and only want to have mast-col showing.

    Needless to say when I did that and did not have a sidebar-1 or 2 selected on those pages nothing showed at all. I was so confused and frustrated and ready to pull my hair out because it took quite a bit of time to figure out why.

    As luck would have it, I managed to duplicate and hack the mainbody-content-left file (code below, which I’m no expert so I don’t know how correct it is) to make it work but not everyone can do this.

    For me it is important that no matter what I have selected (mast-col, sidebar-1, sidebar-2, etc.) and in whichever way I want it to show – it should show, it should work the way I want it to, it should not be dependent on having a sidebar-1 or 2 in use.

    Below is how I changed mainbody-content-left to have any situation work for me regardless of what positions I’ve chosen (note there is mast-col2 that I added as well)

    [PHP]<?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

    /**

    * Mainbody 3 columns, content in left, mast-col on top of 2 sidebars: content – sidebar1 – sidebar2 – mast-col-2 on bottom

    */

    // positions configuration

    $mastcol = ‘mast-col’;

    $sidebar1 = ‘sidebar-1’;

    $sidebar2 = ‘sidebar-2’;

    $mastcol2 = ‘mast-col-2’;

    $mastcol = $this->countModules($mastcol) ? $mastcol : false;

    $sidebar1 = $this->countModules($sidebar1) ? $sidebar1 : false;

    $sidebar2 = $this->countModules($sidebar2) ? $sidebar2 : false;

    $mastcol2 = $this->countModules($mastcol2) ? $mastcol2 : false;

    if ($sidebar1 && $sidebar2) {

    $this->loadBlock(‘mainbody/ourfile-two-sidebar-right’, array(‘sidebar1’ => $sidebar1, ‘sidebar2’ => $sidebar2, ‘mastcol’ => $mastcol, ‘mastcol2’ => $mastcol2));

    } elseif ($mastcol && ($sidebar1 || $sidebar2)) {

    $this->loadBlock(‘mainbody/ourfile-two-sidebar-right’, array(‘sidebar1’ => $sidebar1, ‘sidebar2’ => $sidebar2, ‘mastcol’ => $mastcol, ‘mastcol2’ => $mastcol2));

    } elseif ($sidebar1 || $sidebar2) {

    $this->loadBlock(‘mainbody/ourfile-two-sidebar-right’, array(‘sidebar1’ => $sidebar1, ‘sidebar2’ => $sidebar2, ‘mastcol’ => $mastcol, ‘mastcol2’ => $mastcol2));

    } else {

    $this->loadBlock(‘mainbody/ourfile-two-sidebar-right’, array(‘sidebar’ => $sidebar1 ? $sidebar1 : $sidebar2, ‘mastcol’ => $mastcol, ‘mastcol2’ => $mastcol2));

    }

    ?> [/PHP]

    Saguaros Moderator
    #531752

    By default, there is no constraint between ‘mast-col’ position and ‘sidebar-1’, ‘sidebar-2’ position. I just tried to download the T3 Blank template, use ‘mainbody-content-left’ layout, disable all modules in 2 sidebar positions, but the module assigned to ‘mast-col’ position still displays correctly.

    krumz Friend
    #531820

    Hmm. I am on a test site and when using t3 bs3 blank template and when I unpublished sidebar 1 and 2, mast col does not show? Mast col will show however, when I have something in sidebar 1 or sidebar 2.

    Saguaros Moderator
    #531863

    I thought that you’re referring to T3 Blank as title of this thread, not T3 bs3 Blank template.

    As you can see in the position configuration in block ‘mainbody-content-left.php’, if there is no module assigned to ‘sidebar-1’ or ‘sidebar-2’ position, it will load block called ‘no-sidebar’ and this block doesn’t include ‘mast-col’ position. That’s reason why the module in ‘mast-col’ doesn’t show.

    You can use solution you posted in this thread 🙂

    krumz Friend
    #535226

    Thanks Saguaros,

    Did not see your response until now. Changing the code the way we did seems to work for us. 😀

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

This topic contains 5 replies, has 2 voices, and was last updated by  krumz 10 years, 6 months ago.

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