V
V
Viorel2017-04-05 11:57:22
PHP
Viorel, 2017-04-05 11:57:22

How to make Joomla logo clickable?

Hello everyone on the site, the logo changes when changing the language,
how to correctly write in this code so that the logo is clickable

<?php
$lang = $this->language;
switch ($lang) {
case "ro-ro":
  echo '<img src="templates/'.$this->template.'/images/akzente-logo-ro.jpg" alt="Akzente Ro" />'; 
break;
case "de-de":
echo '<img src="templates/'.$this->template.'/images/akzente-logo-de.jpg" alt="Akzente De" />';
break;
default:
echo '<img src="templates/'.$this->template.'/images/akzente-logo-ro.jpg" alt="Akzente" />';
break;
}
?>

what would happen like that
<a href="<?php echo $this->baseurl; ?>/">echo '<img src="templates/'.$this->template.'/images/akzente-logo-ro.jpg" alt="Akzente" />' </a>

I forgot a bit of php)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2017-04-05
@bushido2014

function theLogo($obj) {
    switch ($obj->language) {
        case "ro-ro":
            $image =  '<img src="templates/' . $obj->template . '/images/akzente-logo-ro.jpg" alt="Akzente Ro" />';
            break;
        case "de-de":
            $image = '<img src="templates/' . $obj->template . '/images/akzente-logo-de.jpg" alt="Akzente De" />';
            break;
        default:
            $image =  '<img src="templates/' . $obj->template . '/images/akzente-logo-ro.jpg" alt="Akzente" />';
            break;
    }

    echo '<a href="'.$obj->baseurl.'">'.$image.'</a>';
}

well, the conclusion is
<?php theLogo($this); ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question