Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • krumz Friend
    #1065924

    Hello 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 Moderator
    #1065948

    Hi
    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 Friend
    #1066137

    Is my code correct?

    Thank you.

    Pankaj Sharma Moderator
    #1066181

    Hi
    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 Friend
    #1067094

    Well, 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 Moderator
    #1067138

    Hi
    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 Friend
    #1067335

    Hi 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 Moderator
    #1067399

    Hi
    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

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

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