Tagged: header, JA Simpli, new position
-
AuthorPosts
-
krumz Friend
krumz
- Join date:
- October 2012
- Posts:
- 138
- Downloads:
- 77
- Uploads:
- 22
- Thanks:
- 23
- Thanked:
- 4 times in 2 posts
October 4, 2017 at 8:09 pm #1065924Hello again all,
I am looking to add two new positions directly under the existing Header Positions and right above the Main Nav position.
This is the code that I have come up with, I have not tried it yet as I wanted to make sure I got it right first.
So this is what I will add to index.php in between the Header and Main Navigation code:
<!-- HEADER2 NEW POSITIONS --> <?php if ($helper->is('header2-enabled')) : ?> <header2 id="header2" class="header<?php echo $helper->is('layoutSticky_header') ? ' stick-on-top' : '' ?>" role="banner"<?php $helper->_bg('header2') ?>> <?php $helper->_container_open('header2') ?> <!-- HEADER2 LEFT --> <div class="banner <?php $helper->_('header2-left-class') ?> <?php $helper->_('extraClass_header2_left'); ?> "> <jdoc:include type="modules" name="<?php $helper->_('header2-left-pos') ?>" style="none" /> </div> <!-- // HEADER2 LEFT --> <!-- HEADER2 RIGHT --> <div class="banner <?php $helper->_('header2-right-class') ?> <?php $helper->_('extraClass_header2_right'); ?> "> <jdoc:include type="modules" name="<?php $helper->_('header2-right-pos') ?>" style="none" /> </div> <!-- // HEADER2 RIGHT --> </jdoc:include> <?php $helper->_container_close('header2') ?> </header> <!-- // HEADER2 NEW POSITIONS --> <?php endif ?>
And this is what I will add to templateDetails.xml file:
<!-- Header2 Left --> <field type="legend" name="layoutEnable_header2_left" label="TPL_SIMPLI_LAYOUT_HEADER2_LEFT_GROUP" subgroup="1" expend="all" enabler="1" /> <field name="layoutPos_header2_left" class="" type="ModulePosition" default="header2-left" label="TPL_SIMPLI_LAYOUT_POS_LABEL" description="TPL_SIMPLI_LAYOUT_POS_DESC" /> <field name="layoutWidth_header2_left" class="" type="list" default="" label="TPL_SIMPLI_LAYOUT_WIDTH_LABEL" description="TPL_SIMPLI_LAYOUT_WIDTH_DESC"> <option value="">auto</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="12">12</option> </field> <field name="extraClass_header2_left" class="" type="inputbox" default="" label="TPL_SIMPLI_LAYOUT_POS_LABEL" description="TPL_SIMPLI_LAYOUT_POS_DESC" /> <!-- Header2 Right --> <field type="legend" name="layoutEnable_header_right" label="TPL_SIMPLI_LAYOUT_HEADER2_RIGHT_GROUP" subgroup="1" expend="all" enabler="1" /> <field name="layoutPos_header_right" class="" type="ModulePosition" default="header2-right" label="TPL_SIMPLI_LAYOUT_POS_LABEL" description="TPL_SIMPLI_LAYOUT_POS_DESC" /> <field name="layoutWidth_header2_right" class="" type="list" default="" label="TPL_SIMPLI_LAYOUT_WIDTH_LABEL" description="TPL_SIMPLI_LAYOUT_WIDTH_DESC"> <option value="">auto</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="12">12</option> </field> <field name="extraClass_header2_right" class="" type="inputbox" default="" label="TPL_SIMPLI_LAYOUT_POS_LABEL" description="TPL_SIMPLI_LAYOUT_POS_DESC" />
Now can anyone tell me – when you add this new information to these 2 files and if there is an update to the template – will these files and the new positions be overwritten?
Thanks.
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
October 5, 2017 at 12:01 am #1065948Hi
Template update override the files with fresh files, so you have to take backup of your code or files.
To get the position back in the template.Regards
krumz Friendkrumz
- Join date:
- October 2012
- Posts:
- 138
- Downloads:
- 77
- Uploads:
- 22
- Thanks:
- 23
- Thanked:
- 4 times in 2 posts
October 5, 2017 at 5:25 pm #1066137Is my code correct?
Thank you.
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
October 6, 2017 at 1:49 am #1066181Hi
About the code, it contains custom style and custom work, its not the normal module position code.
For example, Here you can see the code to add a normal module position.vYou can test your code if it working or not as its custom code that contained custom PHP and css work.Regards
krumz Friendkrumz
- Join date:
- October 2012
- Posts:
- 138
- Downloads:
- 77
- Uploads:
- 22
- Thanks:
- 23
- Thanked:
- 4 times in 2 posts
October 10, 2017 at 9:37 pm #1067094Well, this template has beat me down. I tried updating component.php, templateDetails.xml, and index.php following examples from other forum posts, can’t get anything to work – my code (above) didn’t work either. Oh, well, thanks for all your help.
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
October 11, 2017 at 2:33 am #1067138Hi
Kindly follow this documentation for an example of module position code. This template is work same as default Joomla templates like beez3 or Protostar if you applied any custom work that is working on default Joomla template, it also works on this template.Regards
krumz Friendkrumz
- Join date:
- October 2012
- Posts:
- 138
- Downloads:
- 77
- Uploads:
- 22
- Thanks:
- 23
- Thanked:
- 4 times in 2 posts
October 11, 2017 at 5:24 pm #1067335Hi Pankaj,
I did follow the documentation and the other information I found out here on adding to the Simpli template but it just didn’t work for me.
I have extensively added new blocks and module positions to the t3bs3blank template but it’s not working for me here. Not sure what I’m Not doing right. Maybe I’m missing a file to update. Oh Well, I gave it my best shot.
Thanks for all your help though.
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
October 12, 2017 at 2:51 am #1067399Hi
In T3 you have option to add layout block, Did u tested the module position code with default Joomla template that you shared above?<jdoc:include type="modules" name="<?php $this->_p('your_module_position_name') ?>" />
This code working fine for me, you can see other position codes too in the index.php file to take an example.
Regards
-
AuthorPosts
This topic contains 7 replies, has 2 voices, and was last updated by Pankaj Sharma 7 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum