We moved to new unified forum!

Please post all new support queries in our New Forum.

T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. Kathy
  2. General Discussion
  3. Wednesday, 16 April 2014
  4.  Subscribe via email
Hello All,

So it took quite a while to figure out that the mast-col position will not show unless sidebar-1 or sidebar-2 is 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 also.

<?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));
}

?>


Thoughts or comments?
krumz
  California, USA
Visit 
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
You should change the code like following:


if ($mastcol || $mastcol2 || ($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-one-sidebar-right', array('sidebar1' => $sidebar1, 'sidebar2' => $sidebar2, 'mastcol' => $mastcol, 'mastcol2' => $mastcol2));

} else {

$this->loadBlock('mainbody/ourfile-no-sidebar', array('sidebar' => $sidebar1 ? $sidebar1 : $sidebar2, 'mastcol' => $mastcol, 'mastcol2' => $mastcol2));

}



In the sub block, you should also check the position availability before render it.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
Thank you Khanh Le. I will give this a try.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Hello Khanh Le.

I tested the code you gave me and it does not work the way I want it to. If I have nothing in mast-col or mast-col2 then nothing in sidebar-1 or 2 shows either. So far my code above is working right (although not pretty I'm sure) ;)
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.