-
AuthorPosts
-
humusjey Friend
humusjey
- Join date:
- March 2009
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 4 times in 1 posts
March 30, 2011 at 7:22 pm #162162Hello everyone!
I need to change the layout of my theme but I don’t know how to do it..
This is what I want:
left1 left2 left3 content
But, by default, you can only have 2 modules per side
<block name=”left1″>left</block>
<block name=”left2″>right</block>
<block name=”right1″>left</block>
<block name=”right2″>right</block>
How to create a new module position for left3?
Thank you!
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
March 31, 2011 at 4:03 am #3841921) you take an overview on the layout concept http://wiki.joomlart.com/wiki/JA_Template_Framework/Guides
2) You follow this guide to re-make the layout xml code http://wiki.joomlart.com/wiki/JA_T3_Framework_2/Guides#Default_Layouthumusjey Friendhumusjey
- Join date:
- March 2009
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 4 times in 1 posts
March 31, 2011 at 8:46 pm #384342Hi Tiench,
I found this..
http://wiki.joomlart.com/wiki/JA_Template_Framework/FAQs#Layout_overrideAnd I see how to override one or more layouts but, this is an example for JA Purity II template.
Would this work for a t3_blank template?
Is this the same beginning for JAT3 2? And If it’s, how one can do that because the folders and files have a different hierarchy and I’ve tried with no successfully.I will like to know your thoughts about this.
Thank you!
humusjey Friendhumusjey
- Join date:
- March 2009
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 4 times in 1 posts
April 1, 2011 at 4:53 pm #384472This is what I’ve done.
Copy pluginssystemjat3base-themesdefaultpagedefault.php
Paste it in templatesyour-templatepagedefault.php (you need to create “page” directory)
Open the file and add the new position:
<?php
$cls1 = $cls2 = $cls3 = "";
if ($this->hasBlock('left1') && $this->hasBlock('left2') && $this->hasBlock('left3')) {
$cls1 = "ja-left1";
$cls2 = "ja-left2";
$cls3 = "ja-left3";
}
if ($this->hasBlock('left1') || $this->hasBlock('left2') || $this->hasBlock('left3')):
?>
<div class="ja-colswrap clearfix <?php echo $this->getColumnWidth('cls_l'); ?>">
<?php if ($this->hasBlock('left1')):
$block = &$this->getBlockXML('left1');
?>
<div id="ja-left1" class="ja-col <?php echo $cls1;?> column" style="width:<?php echo $this->getColumnWidth('l1')?>%">
<?php $this->showBlock ($block); ?>
</div>
<?php endif ?><?php if ($this->hasBlock('left2')):
$block = &$this->getBlockXML('left2');
?>
<div id="ja-left2" class="ja-col <?php echo $cls2;?> column" style="width:<?php echo $this->getColumnWidth('l2')?>%">
<?php $this->showBlock ($block); ?>
</div>
<?php endif ?><?php if ($this->hasBlock('left3')):
$block = &$this->getBlockXML('left3');
?>
<div id="ja-left3" class="ja-col <?php echo $cls3;?> column" style="width:<?php echo $this->getColumnWidth('l3')?>%">
<?php $this->showBlock ($block); ?>
</div>
<?php endif ?>
</div>
<?php endif ?>
In this way I can create another position BUT it doesn’t have a right align so I must give to my new module position the same height than left1 and left2.
Copy pluginssystemjat3base-themesdefaultblocksfixheight.php
Paste it in templatesyour-templatelocalthemesyour-themeblocks
Open the file and edit:
fixHeight (['ja-left1', 'ja-left2', 'ja-left3'], ['ja-left'], ['ja-left-mass-top', 'ja-left-mass-bottom']);
Nice! but it’s not enough yet =/ because T3 is not recognized the position. Why? Well, I don’t know hahaha come on! I know this because doesn’t work yet. So I investigated and found this:
In pluginssystemjat3corelayout.php
Open it and search for #30 line:
function parseLayout () {
//parse layout
$this->_colwidth = array();
//Left
$l = $l1 = $l2 = $l3 = 0;
$left1 = $this->getPositionName ('left1');
$left2 = $this->getPositionName ('left2');
$left3 = $this->getPositionName ('left3');
$mt = $this->getPositionName ('left-mass-top');
$mb = $this->getPositionName ('left-mass-bottom');
if ($this->countModules ("$mt") || $this->countModules ("$mb") || ($this->countModules ("$left1") && $this->countModules ("$left2") && $this->countModules ("$left3"))) {
$l = 3;
$l1 = $this->getColumnBasedWidth ('left1');
$l2 = $this->getColumnBasedWidth ('left2');
$l3 = $this->getColumnBasedWidth ('left3');
} else if ($this->countModules ("$mt") || $this->countModules ("$mb") || ($this->countModules ("$left1") && $this->countModules ("$left2"))) {
$l = 2;
$l1 = $this->getColumnBasedWidth ('left1');
$l2 = $this->getColumnBasedWidth ('left2');
} else if ($this->countModules("$left1")) {
$l = 1;
$l1 = $this->getColumnBasedWidth ('left1');
} else if ($this->countModules("$left2")) {
$l = 1;
$l2 = $this->getColumnBasedWidth ('left2');
} else if ($this->countModules("$left3")) {
$l = 1;
$l3 = $this->getColumnBasedWidth ('left3');
}
$cls_l = $l?"l$l$l":"";
$l = $l1 + $l2 + $l3;
The red color code means what I think is for to add the module width to the new module position but it doesn’t work >:( I don’t know if I’m wrong or if something is missing. Please, if anyone can help me please I will be very grateful.
humusjey Friendhumusjey
- Join date:
- March 2009
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 4 times in 1 posts
April 5, 2011 at 6:59 am #384888Nobody? =/
May 4, 2011 at 11:08 pm #389865I can’t believe this guy put this much work into trying to add more modules and NOBODY on the staff has even attempted to answer his question. Now look I’m a coder as well and I may not be the best but I can understand your code and I’m learning the structure. But I need the same thing this guy needs. None of my templates will be stock and I need a tutorial on how to create inline modules, so if you answer this guys question you’ll also answer mine.
Reguards.
ꦯꦸꦕꦶ ꦏꦸꦂꦤꦶꦲꦮꦤ꧀ Friendꦯꦸꦕꦶ ꦏꦸꦂꦤꦶꦲꦮꦤ꧀
- Join date:
- April 2008
- Posts:
- 100
- Downloads:
- 9
- Uploads:
- 11
- Thanks:
- 8
- Thanked:
- 39 times in 32 posts
May 5, 2011 at 4:40 am #389898I think as @tienhc pointed, you can modify it this way (with T3 v2 in mind):
1. open your layout at *root*/templates/your_template/core/etc/layouts/your_layout.xml
2. edit it and adjust the code to<block name="left1">left1</block>
<block name="left2">left2</block>
<block name="inset1">left3</block>and don’t forget to define your new position in your templateDetails.xml
hope this help
humusjey Friendhumusjey
- Join date:
- March 2009
- Posts:
- 27
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 4 times in 1 posts
May 9, 2011 at 7:25 pm #390448Actually @nawainruk that’s exactly what I did. I thought, ok, I can’t modify the main structure of T3 to get a Left3 so lets do it with blocks.
I’ve created a new layout structure with blocks and it works, but then I thought, this is not the way to do this, why? Look, it supposed that a framework it’s made it just for one an unique reason: make things easier; but in this case isn’t happen. And I’m gonna sound a little weird and contradictorily but it’s ok. T3 Framework works with 3 important layout divisions: Top, Middle, Bottom. No more! And maybe this is the same reason why this framework it’s weak, from my point of view of structure, of course. Note: I’m not saying that this doesn’t work fine or it’s not worth it but sometimes T3 can make you think the worst hehe.
And just for the record, I’m not mad with the JA staff, I think they didn’t have the time to answer my question. Anyway, I already fixed the problem and I recommend to use blocks to alter all the layout structure in case you need it.
Greets.
-
AuthorPosts
This topic contains 8 replies, has 4 voices, and was last updated by humusjey 13 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum