0

I am trying to edit my index.php for languages and just trying to put my logo on right.

Could you please show me what am I doing wrong?

I want to put my logo on the left when language is arabic aa-AA and logo on the right when language is english en-GB

Thanks,

<?php
  $lang = JFactory::getLanguage();
  $result = $lang->getTag();
  if ($result=="en-GB") { 

       <div id="jf-logo">

        <a href="index.php"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.png" alt="JF Texturia"/></a>

      </div>

      <!-- Main menu module -->

      <div id="jf-mainmenu">

        <?php if($this->countModules('mainmenu')) : ?>



           <jdoc:include type="modules" name="mainmenu" />



        <?php endif; ?>

        <div id="jf-submenu"><jdoc:include type="modules" name="submenu" /></div>

      </div>
  } 
  else { 
       <!-- Main menu module -->

      <div id="jf-mainmenu">

        <?php if($this->countModules('mainmenu')) : ?>



           <jdoc:include type="modules" name="mainmenu" />



        <?php endif; ?>

        <div id="jf-submenu"><jdoc:include type="modules" name="submenu" /></div>

      </div>

       <div id="jf-logo">

        <a href="index.php"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.png" alt="JF Texturia"/></a>

      </div>
  }
?> 
2
  • Please clarify. You want to pull your logo to the right when language is "en-GB ? Please update you question, because it is not clear what you want to achieve. Commented Mar 2, 2015 at 9:25
  • sorry, i want to put my logo on the left when language is arabic aa-AA and logo on the right when language is english en-GB.
    – burc
    Commented Mar 2, 2015 at 9:26

2 Answers 2

1

I am probably misunderstanding something here...

You can simply make a module position, two logo modules (custom HTML, really) with a language specified and let Joomla! handle it.

Or you can do it in the CSS using the html[lang="aa-AA"] selector. See attribute selectors. Browser compatibility is good enough I think. (ie anyone using a browser too old for this has bigger problems with your Joomla site...)

0

Ville Niemi gave you the best answer here.

I think your main problem is that you are mixing up HTML and PHP code. Your file should rather look like:

<?php
  $lang = JFactory::getLanguage();
  $result = $lang->getTag();
  if ($result=="en-GB") { ?>

       <div id="jf-logo">

        <a href="index.php"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.png" alt="JF Texturia"/></a>

      </div>

      <!-- Main menu module -->

      <div id="jf-mainmenu">

        <?php if($this->countModules('mainmenu')) : ?>



           <jdoc:include type="modules" name="mainmenu" />



        <?php endif; ?>

        <div id="jf-submenu"><jdoc:include type="modules" name="submenu" /></div>

      </div>
  <?php
  } 
  else { ?>
       <!-- Main menu module -->

      <div id="jf-mainmenu">

        <?php if($this->countModules('mainmenu')) : ?>



           <jdoc:include type="modules" name="mainmenu" />



        <?php endif; ?>

        <div id="jf-submenu"><jdoc:include type="modules" name="submenu" /></div>

      </div>

       <div id="jf-logo">

        <a href="index.php"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.png" alt="JF Texturia"/></a>

      </div>
<?php
  }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.