Multilang logo image

Responsive, suitable for any type of business, built for any needs elegant one-page Joomla template.
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Dec 31, 2013 1:51 am
Reply with quote
Report this post
Hello, all!
Is there a way to set up multilang logo with logo type image?
User avatar
Senior Boarder

teitbite
Tue Dec 31, 2013 4:15 am
Reply with quote
Report this post
Hi

My first idea is to create new template style with a different logo and attache it to a certain language. Please try this and if You will have problems let me know.
User avatar
Moderator

GK User
Tue Dec 31, 2013 10:24 am
Reply with quote
Report this post
I'm not sure I understand. Please define " attache it to a certain language". Tnx
User avatar
Senior Boarder

teitbite
Tue Dec 31, 2013 6:48 pm
Reply with quote
Report this post
Hi

For example You have English and German language on Your site.

1. Go to template manager. Create 2 new styles, call one of them for example "Default EN" and other "Default DE"
2. In each of this styled define a correct logo which should be used for a language the style was created for
3. Each of the styles should be set (attached) to a language for which it was created for, screen may help here:
User avatar
Moderator

GK User
Wed Jan 01, 2014 1:13 pm
Reply with quote
Report this post
OK, I tried with subpages and with frontpage, not working.
User avatar
Senior Boarder

teitbite
Thu Jan 02, 2014 6:20 pm
Reply with quote
Report this post
Hi

Frontpage and subpages styles are a different matter. Please send me an access to joomla panel and I'll make You an example You will be able to follow.
User avatar
Moderator

GK User
Fri Jan 03, 2014 11:49 am
Reply with quote
Report this post
Thank you for your good will. There is a new user system message in your gmail mailbox, with login name and password.
User avatar
Senior Boarder

teitbite
Fri Jan 03, 2014 4:12 pm
Reply with quote
Report this post
Hi

Ok. I've just tried and look like it wasn't my best idea. It's possible to make it this way, but would reguire a lot changes, like making a new menu for start ;/ I've just came out with much easier way of making it. Please edit file /layout/block/logo.php and replace code:

Code: Select all
<?php if ($this->API->get('logo_type', 'image')!=='none'): ?>
     <?php if($this->API->get('logo_type', 'image') == 'css') : ?>
     <h1 class="gkLogo">
        <a href="<?php echo JURI::root(); ?>" id="gkLogo" class="cssLogo"><?php echo $this->API->get('logo_text', ''); ?></a>
     </h1>
     <?php elseif($this->API->get('logo_type', 'image')=='text') : ?>
     <h1 class="gkLogo">
        <a href="<?php echo JURI::root(); ?>" id="gkLogo" class="text">
         <span><?php echo $this->API->get('logo_text', ''); ?></span>
         <?php if($this->API->get('logo_slogan', '') != '') : ?>
           <small class="gkLogoSlogan"><?php echo $this->API->get('logo_slogan', ''); ?></small>
           <?php endif; ?>
        </a>
     </h1>
     <?php elseif($this->API->get('logo_type', 'image')=='image') : ?>
     <h1 class="gkLogo">
        <a href="<?php echo JURI::root(); ?>" id="gkLogo">
           <img src="<?php echo $logo_image; ?>" alt="<?php echo $this->API->getPageName(); ?>" />
        </a>
     </h1>
     <?php endif; ?>
<?php endif; ?>


with

Code: Select all
     <h1 class="gkLogo">
        <a href="<?php echo JURI::root(); ?>" id="gkLogo">
           <img src="images/logo_<?php echo $this->APITPL->language; ?>.png" alt="<?php echo $this->API->getPageName(); ?>" />
        </a>
     </h1>


Than upload to joomla /images folder 2 logos with names logo_hr-hr.png and logo_en-gb.png
User avatar
Moderator

GK User
Fri Jan 03, 2014 9:38 pm
Reply with quote
Report this post
Thanks for your efforts.
Now there is no logo displayed at all.
I'm not a programmer, so my knowledge about coding is very limited. My logo.php looks like this, can you check?

Code: Select all
<?php

// No direct access.
defined('_JEXEC') or die;
$logo_image = $this->API->get('logo_image', '');

if(($logo_image == '') || ($this->API->get('logo_type', '') == 'css')) {
     $logo_image = $this->API->URLtemplate() . '/images/logo.png';
} else {
     $logo_image = $this->API->URLbase() . $logo_image;
}

$logo_text = $this->API->get('logo_text', '');
$logo_slogan = $this->API->get('logo_slogan', '');

?>

         <h1 class="gkLogo">
            <a href="<?php echo JURI::root(); ?>" id="gkLogo">
               <img src="images/logo_<?php echo $this->APITPL->language; ?>.png" alt="<?php echo $this->API->getPageName(); ?>" />
            </a>
         </h1>
User avatar
Senior Boarder

teitbite
Sun Jan 05, 2014 5:05 am
Reply with quote
Report this post
Hi

It's almost fine. Problem is that language recognision value must be wrong. Please send me an access to ftp and I'll check what code will work for You and fix it.
User avatar
Moderator

teitbite
Tue Jan 07, 2014 2:58 pm
Reply with quote
Report this post
Hi

Looks like code was fine, just the file was not right :)

I have edite file /layout/default.php and replaced line 64:

Code: Select all
                <?php //$this->layout->loadBlock('logo'); ?>


to

Code: Select all
      <h1 class="gkLogo">
         <a href="<?php echo JURI::root(); ?>" id="gkLogo"><img src="images/logo_<?php echo $this->APITPL->language; ?>.png" alt="<?php echo $this->API->getPageName(); ?>" /></a>
      </h1>


and logo is changing according to a language selected.
User avatar
Moderator

GK User
Wed Jan 08, 2014 5:26 pm
Reply with quote
Report this post
teitbite, thank you.
i just wanted to say that reason why i was asking for multilang logo if logo is set to "image" type.
if you set logo as "css", you allways have to do some extra work on css. if you set logo as image, template is doing the rest of work, by sizing and positioning image correctly.
User avatar
Senior Boarder

teitbite
Fri Jan 10, 2014 6:40 am
Reply with quote
Report this post
Hi

I'm afraid I've removed the css option to avoid problems with multilanguage logo since it would be much more difficult to make it with css one. Sorry. Just let me know and I'll restore it.
User avatar
Moderator


cron