creating a custom html module in the Logo position?

GK User
Thu Jun 23, 2011 9:47 pm
Id like to add a custom html module in the logo position but it doesnt appear.

My aim is to place one logo in this position for unregistered visitors and a different logo for registered users which i cannot do by using the text/image logo option in the template manager.

The template position is already there so do i just need to add something to the mainnav.php for modules in this position to appear?

Your help would be greatly appreciated.
User avatar
Junior Boarder

GK User
Mon Jul 11, 2011 8:15 pm
Incase anybody else is looking to do the same thing this is how its done....

Assuming your using J!1.5, what you should do is to add the new module position on templateDetails.xml file, like this:

<position>yourposition</position>

Them open mainnav.php and comment:
<?php
$siteName = $this->sitename();
if ($this->getParam('logoType')=='image'):
?>

<h1 class="logo">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1>

<?php elseif ($this->getParam('logoType') == 'text') : ?>

<?php
$logoText = (trim($this->getParam('logoType-text-logoText'))=='') ? $config->sitename : $this->getParam('logoType-text-logoText');
$sloganText = (trim($this->getParam('logoType-text-sloganText'))=='') ? JText::_('SITE SLOGAN') : $this->getParam('logoType-text-sloganText');
?>

<div class="logo-text">
<h1><a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a></h1>
<p class="site-slogan"><?php echo $sloganText;?></p>
</div>

<?php endif; ?>


Then add

<?php if( $this->countModules('yourmodule) ): ?>
<div id="yourmodule">
<jdoc:include type="modules" name="yourmodule" style="none" />
</div>
<?php endif; ?>

Naturally you need to add css classes for this div.
User avatar
Junior Boarder


cron