Changer le logo si changement de langue avec T3 & T4 :

 

1. For templates developed with JA T3v2 framework

#1. Detect logo for different languages

Open the file: templates/ja_template/blocks/header.php.

If you don't have the file, please copy the file: plugins\system\jat3\jat3\base-themes\default\blocks\header.php.

 

When you open the file, find the code like this:

<img src="/<?php echo 'templates/'.T3_ACTIVE_TEMPLATE.'/images/logo-trans.png' ?>" alt="<?php echo $siteName; ?>" />

Replace the code with:

<?php if (JFactory::getLanguage()->getTag()=="en-GB"):?>
 
		<img src="/<?php echo 'templates/'.T3_ACTIVE_TEMPLATE.'/images/logo-trans_en.png' ?>" alt="<?php echo $siteName; ?>" />
 
		<?php else: ?>
 
		<img src="/<?php echo 'templates/'.T3_ACTIVE_TEMPLATE.'/images/logo-trans_another.png' ?>" alt="<?php echo $siteName; ?>" />
 
<? endif; ?>

 

 

 

For templates developed with T3 framework

Open the file: templates/ja_template/blocks/header.php.

If you don't have the file, please copy the file: plugins\system\jat3\jat3\base-themes\default\blocks\header.php.

 

When you open the file, find the code:

 

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

 

Replace the code:

 

<a href="/<?php echo JURI::base(true) ?>" title="<?php echo strip_tags($sitename) ?>">
 
	<?php if($logotype == 'image'): ?>
 
		<?php if (JFactory::getLanguage()->getTag()=="en-GB"):?>
 
			<img class="logo-img" src="/<?php echo 'templates/'.T3_TEMPLATE . '/images/logo.png' ?>" alt="<?php echo $siteName; ?>" />
 
			<?php else: ?>
 
			<img src="/<?php echo 'templates/'.T3_TEMPLATE . '/images/logo-mobile.png' ?>" alt="<?php echo $siteName; ?>" />
 
		<? endif; ?>
 
	<?php endif ?>
 
	<?php if($logoimgsm) : ?>
 
		<?php if (JFactory::getLanguage()->getTag()=="en-GB"):?>
 
			<img class="logo-img-sm" src="/<?php echo 'templates/'.T3_TEMPLATE . '/images/logo.png' ?>" alt="<?php echo $siteName; ?>" />
 
			<?php else: ?>
 
			<img src="/<?php echo 'templates/'.T3_TEMPLATE . '/images/logo-mobile.png' ?>" alt="<?php echo $siteName; ?>" />
 
		<? endif; ?>
 
	<?php endif ?>
 
	<span><?php echo $sitename ?></span>
 
</a>

 

 

 

1. For templates developed with JA T4 framework

#1. Detect logo for different languages

Copy Folder if doesn't allready exist : plugins/system/t4/layouts/t4/element/

And the File : plugins/system/t4/layouts/t4/element/logo.php

To

/templates/My_Template/html/layouts/t4/

 

Find :

<a class="navbar-brand t4-logo" href="/index.php"><img src="/<?php echo $logoFile ?>" alt="T4 Blank" /></a>

 

 

Replace with :

<?php if (JFactory::getLanguage()->getTag()=="en-GB"):?>
 
        <a class="navbar-brand " href="/index.php"><img src="/<?php echo 'images/logos/hepatinov/svg/logo-hepatinov-negatif.svg' ?>" alt="" /></a>
 
        <?php else: ?>
 
        <a class="navbar-brand " href="/index.php"><img src="/<?php echo 'images/logos/hepatinov/svg/logo-hepatinov.svg' ?>" alt="" /></a>
 
<?php endif; ?>

 

You have to delete or add some class or make some little change to the code!