test
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • gianco Friend
    #192340

    Just a question…may be simple but..
    How can I have a sidebar in the default template?

    and how to have home feature position in sidebar template?
    Is possible to ave another sidebar in left position?

    Thanks all

    pavit Moderator
    #512550

    Hi

    <blockquote>Just a question…may be simple but..
    How can I have a sidebar in the default template?</blockquote>

    Open this file templatesja_muzictplsdefault.php

    <body>

    <?php $this->loadBlock ('header') ?>

    <?php $this->loadBlock ('feature') ?>

    <?php $this->loadBlock ('spotlight-1') ?>

    <?php $this->loadBlock ('mainbody') ?>

    <?php $this->loadBlock ('spotlight-2') ?>

    <?php $this->loadBlock ('navhelper') ?>

    <?php $this->loadBlock ('footer') ?>

    </body>

    Change the <?php $this->loadBlock (‘mainbody’) ?> to <?php $this->loadBlock (‘mainbody-sidebar’) ?>

    <blockquote>and how to have home feature position in sidebar template?</blockquote>

    Open this file templatesja_muzictplssidebar.php

    <body class="sidebar-content-default">

    <?php $this->loadBlock ('header') ?>

    <?php $this->loadBlock ('spotlight-1') ?>

    <?php $this->loadBlock ('mainbody-sidebar') ?>

    <?php $this->loadBlock ('navhelper') ?>

    <?php $this->loadBlock ('footer') ?>

    </body>

    Add this block after the header block to transform it as shown below

    <body class="sidebar-content-default">

    <?php $this->loadBlock ('header') ?>

    <?php $this->loadBlock ('feature') ?>

    <?php $this->loadBlock ('spotlight-1') ?>

    <?php $this->loadBlock ('mainbody-sidebar') ?>

    <?php $this->loadBlock ('navhelper') ?>

    <?php $this->loadBlock ('footer') ?>

    </body>

    gianco Friend
    #512570

    Hi Pavit, thanks for the answer.
    It works!:D
    Can you help me to add another sidebar module in left position, too?
    many thanks!

    pavit Moderator
    #512572

    Hi

    To have 2 sidebars you need to modify the mainbody-sidebar.php in this way

    [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
    */

    /**
    * Mainbody 3 columns, content in center: sidebar1 – content – sidebar2
    */
    defined(‘_JEXEC’) or die;
    ?>
    <?php

    // Layout configuration
    $layout_config = json_decode (‘{
    “two_sidebars”: {
    “default” : [ “span7 offset3” , “span3 offset-10” , “span2” ],
    “wide” : [ ],
    “xtablet” : [ “span8 offset4” , “span4 offset-12” , “hidden” ],
    “tablet” : [ “span12” , “span12” , “hidden” ],
    “mobile” : [ “span12” , “span12” , “hidden” ]
    },
    “one_sidebar1”: {
    “default” : [ “span8” , “span4” ],
    “wide” : [],
    “xtablet” : [ “span8” , “span4” ],
    “tablet” : [ “span12” , “span12 spanfirst” ]
    },
    “no_sidebar”: {
    “default” : [ “span12” ]
    }
    }’);

    // positions configuration
    $sidebar1 = ‘sidebar-1’;
    $sidebar2 = ‘sidebar-2’;
    // Detect layout
    if ($this->countModules(“$sidebar1 and $sidebar2″)) {
    $layout = ‘two_sidebars’;
    } elseif ($this->countModules($sidebar1)) {
    $layout = ‘one_sidebar1’;
    } elseif ($this->countModules($sidebar2)) {
    $layout = ‘one_sidebar2’;
    } else {
    $layout = ‘no_sidebar’;
    }

    $layout = $layout_config->$layout;
    $col = 0;
    ?>

    <section id=”t3-mainbody” class=”container t3-mainbody”>
    <div class=”row-fluid”>

    <!– MAIN CONTENT –>
    <div id=”t3-content” class=”t3-content <?php echo $this->getClass($layout, $col) ?>” <?php echo $this->getData ($layout, $col++) ?>>
    <div class=”main-content”>
    <jdoc:include type=”message” />
    <jdoc:include type=”component” />
    </div>
    </div>
    <!– //MAIN CONTENT –>

    <?php if ($this->countModules($sidebar1)) : ?>
    <!– SIDEBAR 1 –>
    <div class=”t3-sidebar t3-sidebar-1 <?php echo $this->getClass($layout, $col) ?><?php $this->_c($sidebar1)?>” <?php echo $this->getData ($layout, $col++) ?>>
    <jdoc:include type=”modules” name=”<?php $this->_p($sidebar1) ?>” style=”T3Xhtml” />
    </div>
    <!– //SIDEBAR 1 –>
    <?php endif ?>
    <?php if ($this->countModules($sidebar2)) : ?>
    <!– SIDEBAR 2 –>
    <div class=”t3-sidebar t3-sidebar-2<?php $this->_c($sidebar2, $this->getData($layout, $col++, true)) ?>”>
    <jdoc:include type=”modules” name=”<?php $this->_p($sidebar2) ?>” style=”T3Xhtml” />
    </div>
    <!– //SIDEBAR 2 –>
    <?php endif ?>

    </div>
    </section> [/PHP]

    Take a backup copy of your original file before to make any change

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

This topic contains 4 replies, has 2 voices, and was last updated by  pavit 11 years ago.

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