Question

I created the following website which is in Greek and also has an English version. I can change the blue-white logo from the template folder from the index.php file. I have also exactly same logo in English version. I want the Greek version with Greek logo and English version with english logo. I named my logos as logo2-en-gb.png and logo2-gr-gr.png. Do you know how can I insert it in the index.php file? The website is:

http://www.karabatakis.gr

and the part in index.php is

<div id="header">
     <div id="companyname" style="height:0%">
        <img style="width:77%"  src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo2-en-gb.png" />

        <!-- <a href="<?php echo $this->baseurl ?>"> <?php echo $mainframe->getCfg('sitename') ;?> </a>-->
        <div id="slogan">
           <!-- ΠΟΛΙΤΙΚΟΣ ΜΗΧΑΝΙΚΟΣ -->
        </div>
        <div id="search">
           <jdoc:include type="modules" name="user4" />
        </div>
     </div>

I tried something like this but it does not show me the image

<img style="width:77%"  src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo2-".<?php echo $this->language; ?>.".png" />
Was it helpful?

Solution

Try

if($this->language == en) {
$logo = 'logo2-en-gb.png';
} else { 
$logo = 'logo2-en-gr.png';
}

Then where logo goes echo logo.

<?php echo $logo; ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top