T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. Louw van Riet
  2. General Discussion
  3. Tuesday, 27 August 2013
  4.  Subscribe via email
I hope someone can assist me. I am trying to place a logo image to the left of the Home Button on the mainnav folder. I tried to go through similar questions in the forum and placed the following into my mainnav.php file in the templates/t3_blank/tpls/blocks folder. Unfortunately my logo does not display although a black space has appeared. I have tried to figure it out on my own but I'm really stuck now and would appreciate any insight into what I'm doing wrong.



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

<!-- MAIN NAVIGATION -->
<nav id="t3-mainnav" class="wrap t3-mainnav navbar-fixed-top navbar-collapse-fixed-top">
<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>

<!-- LOGO -->
<div class="span2 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 -->


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


Let me know if you have any questions or need anything else.

Kind Regards,
Attachments (1)
References
  1. http://aqtemp.cloudaccess.net/
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Hi,

why so complicated? Restore the original template-blocks
and add something like this to your template.less:

.t3-mainnav .navbar-inner {
margin-left: 100px; // Should be the width of your logo
background: transparent url('/the/path/to/your/logo') no-repeat 0 0;
}


Please note that I have not tested this - just an idea :)

If you want all the seo bling bling, have a look at the block 'header.php'.
There you can see how to get the needed data that is currently missing
in your block.

Best regards,

Olli
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
Hi Louw!

you are echoing parameters ($logotype, $sitename, etc) that you didn't declare before... so, the logo will never be displayed, just because are empty values...

To see your logo, you must include the $logoimage = $this->params->get('logoimage')... etc, thing....

However... some problems could appear... The div="span2" is declared inside the "span12" so, to me, that should never work up...

I hope it helps!
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
Thanks Daniel and Oliver for the advice. I will see what I can figure out with what you wrote. I really appreciate you writing back and I hope you have a good day.
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 Louw,
Did you have any luck? I'm trying to do the same thing and I tried Oliver's suggestions and my logo is now behind my menu items instead of being to the left of it. I'm still working. WIll post a result if I get it but just thought I'd check...

Thanks!
Attachments (1)
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
i have the same issue. first i added the logo file as an image file in the mainnav file. worked fine. but it does not offer the comfort of doing it from the backend and also use small logo image for smaller screens. so i tried to copy the code from the head, that shows the logo to the mainnav file. i also included the defines, that were missing in the above code.

it did not work out. here is the code. any ideas?
i also tried to get rid of the part that calls the headsearch, because i don't need that part. i also tried to change the size.


<?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', 'templates/' . T3_TEMPLATE . '/images/logo.png') : '';
$logoimgsm = ($logotype == 'image' && $this->params->get('enable_logoimage_sm', 0)) ? $this->params->get('logoimage_sm', '') : 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 navbar navbar-default t3-mainnav navbar-fixed-top navbar-collapse-fixed-top">
<div class="container">

<!-- 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 -->



<!-- 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 -->
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 5
  • Page :
  • 1


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