T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. Dustin
  2. Sherlock Holmes
  3. General Discussion
  4. Tuesday, 20 August 2013
  5.  Subscribe via email
I am messing around with a blank-t3 template.
I know I can add
.navbar-fixed-top
to
<nav id="t3-mainnav" class="wrap t3-mainnav navbar-collapse-fixed-top">
to get the main navigation to "stick" to the top of the window. I'd like to have the logo and search section stay above the nav and have the main navigation stick to the bottom of that. Using devtools I can drag the <header> inside the
<div class="navbar-inner">
while giving the body
top-padding: 150px;
. This all works but knowing that the header.php and mainnav.php are separate what is the proper way to execute this in the template? Still learning, just looking for some guidance.
Comment
There are no comments made yet.
Accepted Answer
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Dustin,

T3 Blank is just a starter template. You can edit, delete, merge, separate merge those blocks to fit your need.
You do not need to keep the original file structure.

Regards


I'm not all that savvy in php yet. Here is what I did to edit the template, please let me know if you suggest another method or if I left something out I should do.

I created a new filed in the /t3_blank/tpls/blocks/ folder called "header_mainnav.php". Ended up inserting the header as the first child of the <nav> Here is what the file looks like:

<?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;
$sitename = $this->params->get('sitename') ? $this->params->get('sitename') : JFactory::getConfig()->get('sitename');
$slogan = $this->params->get('slogan');
$logotype = $this->params->get('logotype', 'text');
$logoimage = $logotype == 'image' ? $this->params->get('logoimage', '') : '';
if ($logoimage) {
$logoimage = ' style="background-image: url('/.JURI::base(true).'/'.$logoimage.');"';
}
?>

<!-- MAIN NAVIGATION -->
<nav id="t3-mainnav" class="wrap t3-mainnav navbar-fixed-top navbar-collapse-fixed-top">

<!-- HEADER -->
<header id="t3-header" class="container t3-header">
<div class="row">

<!-- LOGO -->
<div class="span8 logo">
<div class="logo-<?php echo $logotype ?>">
<a href="/<?php echo JURI::base(true) ?>" title="<?php echo strip_tags($sitename) ?>"<?php echo $logoimage ?>>
<span><?php echo $sitename ?></span>
</a>
<small class="site-slogan hidden-phone"><?php echo $slogan ?></small>
</div>
</div>
<!-- //LOGO -->

<?php if($this->countModules('head-search or languageswitcherload')): ?>
<div class="span4 clearfix">
<?php if ($this->countModules('head-search')) : ?>
<!-- HEAD SEARCH -->
<div class="head-search<?php $this->_c('head-search')?>">
<jdoc:include type="modules" name="<?php $this->_p('head-search') ?>" style="raw" />
</div>
<!-- //HEAD SEARCH -->
<?php endif ?>

<?php if ($this->countModules('languageswitcherload')) : ?>
<!-- LANGUAGE SWITCHER -->
<div class="languageswitcherload">
<jdoc:include type="modules" name="<?php $this->_p('languageswitcherload') ?>" style="raw" />
</div>
<!-- //LANGUAGE SWITCHER -->
<?php endif ?>
</div>
<?php endif ?>

</div>
</header>
<!-- //HEADER -->

<div class="container navbar">
<div class="navbar-inner">

<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<i class="icon-reorder"></i>
</button>

<div class="nav-collapse collapse<?php echo $this->getParam('navigation_collapse_showsub', 1) ? ' always-show' : '' ?>">
<?php if ($this->getParam('navigation_type') == 'megamenu') : ?>
<?php $this->megamenu($this->getParam('mm_type', 'mainmenu')) ?>
<?php else : ?>
<jdoc:include type="modules" name="<?php $this->_p('mainnav') ?>" style="raw" />
<?php endif ?>
</div>
</div>
</div>
</nav>
<!-- //MAIN NAVIGATION -->


I then went and changed the loadBlock calls of

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


to just


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


for the following files:

default.php
default-content-left.php
default-content-right.php
default-joomla-2.5.php
default-joomla-3.0.php
home-1.php
home-2.php


I still need to edit the CSS of the body so it shows under the header but everything else looks to be working correctly. I'd just like to know if this was the best/correct method of attack and if I left anything out.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # Permalink
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Dustin,

T3 Blank is just a starter template. You can edit, delete, merge, separate merge those blocks to fit your need.
You do not need to keep the original file structure.

Regards
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
Yes, it should be like that. Congrat!
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 !
There is an error with this line:
if ($logoimage) {

$logoimage = ' style="background-image: url('/.JURI::base(true').'/'.$logoimage.');"';

So, the code does not work.
I have corrected the (true') with (true) but it is still not correct.
Is there somebody here who can help me ?
Thanks a lot !!
Eric
  34000 Montpellier, France
Visit 
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Freget,

Please try to replace your code with this:

if ($logoimage) {

$logoimage = ' style="background-image: url(/'.JURI::base(true).'/'.$logoimage.');"';


Gardner.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
thanks you very much !
it's working now ;) except that I have lost my logo and my navbar is transparent and not fullwidth :(
http://ericfreget.com/T3/

Eric
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 5
Accepted Answer Pending Moderation
0
Votes
Undo
here my new working code :

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

// get params
$sitename = $this->params->get('sitename');
$slogan = $this->params->get('slogan', '');
$logotype = $this->params->get('logotype', 'text');
$logoimage = $logotype == 'image' ? $this->params->get('logoimage', T3Path::getUrl('images/logo.png', '', true)) : '';
$logoimgsm = ($logotype == 'image' && $this->params->get('enable_logoimage_sm', 0)) ? $this->params->get('logoimage_sm', T3Path::getUrl('images/logo-sm.png', '', true)) : false;

if (!$sitename) {
$sitename = JFactory::getConfig()->get('sitename');
}

$logosize = 'col-sm-12';
if ($headright = $this->countModules('head-search or languageswitcherload')) {
$logosize = 'col-sm-8';
}

?>



<!-- MAIN NAVIGATION -->

<nav id="t3-mainnav" class="wrap t3-mainnav navbar-fixed-top navbar-collapse-fixed-top">



<!-- HEADER -->

<header id="t3-header" class="container t3-header">

<div class="row">

<!-- LOGO -->
<div class="col-xs-12 <?php echo $logosize ?> logo">
<div class="logo-<?php echo $logotype, ($logoimgsm ? ' logo-control' : '') ?>">
<a href="/<?php echo JURI::base(true) ?>" title="<?php echo strip_tags($sitename) ?>">
<?php if($logotype == 'image'): ?>
<img class="logo-img" src="/<?php echo JURI::base(true) . '/' . $logoimage ?>" alt="<?php echo strip_tags($sitename) ?>" />
<?php endif ?>
<?php if($logoimgsm) : ?>
<img class="logo-img-sm" src="/<?php echo JURI::base(true) . '/' . $logoimgsm ?>" alt="<?php echo strip_tags($sitename) ?>" />
<?php endif ?>
<span><?php echo $sitename ?></span>
</a>
<small class="site-slogan"><?php echo $slogan ?></small>
</div>
</div>
<!-- //LOGO -->

<?php if ($headright): ?>
<div class="col-xs-12 col-sm-4">
<?php if ($this->countModules('head-search')) : ?>
<!-- HEAD SEARCH -->
<div class="head-search <?php $this->_c('head-search') ?>">
<jdoc:include type="modules" name="<?php $this->_p('head-search') ?>" style="raw" />
</div>
<!-- //HEAD SEARCH -->
<?php endif ?>

<?php if ($this->countModules('languageswitcherload')) : ?>
<!-- LANGUAGE SWITCHER -->
<div class="languageswitcherload">
<jdoc:include type="modules" name="<?php $this->_p('languageswitcherload') ?>" style="raw" />
</div>
<!-- //LANGUAGE SWITCHER -->
<?php endif ?>
</div>
<?php endif ?>

</div>
</header>
<!-- //HEADER -->


<div class="container navbar">

<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">

<?php if ($this->getParam('navigation_collapse_enable', 1) && $this->getParam('responsive', 1)) : ?>
<?php $this->addScript(T3_URL.'/js/nav-collapse.js'); ?>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".t3-navbar-collapse">
<i class="fa fa-bars"></i>
</button>
<?php endif ?>

<?php if ($this->getParam('addon_offcanvas_enable')) : ?>
<?php $this->loadBlock ('off-canvas') ?>
<?php endif ?>

</div>

<?php if ($this->getParam('navigation_collapse_enable')) : ?>
<div class="t3-navbar-collapse navbar-collapse collapse"></div>
<?php endif ?>

<div class="t3-navbar navbar-collapse collapse">
<jdoc:include type="<?php echo $this->getParam('navigation_type', 'megamenu') ?>" name="<?php echo $this->getParam('mm_type', 'mainmenu') ?>" />
</div>

</div>
</nav>

<!-- //MAIN NAVIGATION —>


I'm looking for the way now to change the css to make the body going underneath the header and where to change the z-index because the body is upon the header.
And the main problem I have is to find this in the only one big line in the css !!
any clue ?

http://ericfreget.com/T3/
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 6
Accepted Answer Pending Moderation
0
Votes
Undo
Here is your added code?

<div class="container navbar">
<!-- Brand and toggle get grouped for better mobile display -->

<div class="navbar-header">

<?php if ($this->getParam('navigation_collapse_enable', 1) && $this->getParam('responsive', 1)) : ?>

<?php $this->addScript(T3_URL.'/js/nav-collapse.js'); ?>

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".t3-navbar-collapse">

<i class="fa fa-bars"></i>

</button>

<?php endif ?>

<?php if ($this->getParam('addon_offcanvas_enable')) : ?>

<?php $this->loadBlock ('off-canvas') ?>

<?php endif ?>

</div>

<?php if ($this->getParam('navigation_collapse_enable')) : ?>

<div class="t3-navbar-collapse navbar-collapse collapse"></div>

<?php endif ?>

<div class="t3-navbar navbar-collapse collapse">

<jdoc:include type="<?php echo $this->getParam('navigation_type', 'megamenu') ?>" name="<?php echo $this->getParam('mm_type', 'mainmenu') ?>" />

</div>

</div>

</nav>


Please try to change the "</nav>" to "div"

Gardner.
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 7
  • Page :
  • 1


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