[Not a feature request] Header images languages selection

This forum contains all bugs reported in beta2 and prior versions. As we already released a new version, we recommend you to upgrade. Support for 2.0 beta versions is discontinued.
Forum rules
You can not post new bugs here. Please upgrade to new version, which is already available.
2.0 Beta versions are no longer supported.

[Not a feature request] Header images languages selection

Postby formulador on Wed Jul 30, 2008 2:45 pm

Subject: Selecting header images accordingly to the language: pt (portuguese) or en (English) selected by the user.

Ref.: Jamba template from Joomla!Shack
http://www.joomlashack.com/index.php?op ... &Itemid=43
That template has five styles I would like to use. So, the header image selection for the selected language should consider that.

Original code tag h1 of that template
<h1>
<?php if ($headerstyle=='graphic') { ?>
<a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><img src="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/images/<?php echo $scheme;?>/logo.png" title="<?php echo $headline; ?>" alt="<?php echo $slogan; ?>"/></a>
<?php } ?>
<?php if ($headerstyle=='text') { ?>
<a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><?php echo $headline;?></a>
<?php } ?>
</h1>

I created two folders inside /templates/js_jamba/images/style1/en and /templates/js_jamba/images/style1/pt folders and placed inside each a portugues or english logo.png files as the case.

Modified code to improve header images selection accordingly to the selected language

<h1>
<?php if ($headerstyle=='graphic') { ?>
<?php
$imageDir = "<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/images/<?php echo $scheme;?>"
$langImageDir = '/' . $GLOBALS['mosConfig_lang'];
if( dir_exists($imageDir . $langImageDir ) ) { $imageDir = $imageDir . $langImageDir;}?>

<a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><img src = "<?php echo $imageDir;?>/logo.png" title="<?php echo $headline; ?>" alt="<?php echo $slogan; ?>"></a>;

<?php } ?>

<?php if ($headerstyle=='text') { ?>
<a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><?php echo $headline;?></a>
<?php } ?>
</h1>

The modified code is not working.

Could somebody see why, and where is the mistake?

Thank you.

Samuel
formulador
Newbee
 
Posts: 11
Joined: Wed Jun 25, 2008 9:25 pm

Re: Header images languages selection

Postby ivo.apostolov on Wed Jul 30, 2008 7:28 pm

Are you using J1.5 with JF2.0?

Btw. - wrong forum, moving.
User avatar
ivo.apostolov
Contributor
 
Posts: 3248
Joined: Sat Oct 20, 2007 10:39 am
Location: Sofia

Re: Header images languages selection

Postby ivo.apostolov on Wed Jul 30, 2008 7:36 pm

Code: Select all
<h1>
<?php if ($headerstyle=='graphic') { ?>
<a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><img src="<?php echo $this->baseurl;?>/templates/<?php echo $this->template;?>/images/<?php echo $scheme;?>/<?php echo $this->language; ?>/logo.png" title="<?php echo $headline; ?>" alt="<?php echo $slogan; ?>"/></a>
<?php } ?>
<?php if ($headerstyle=='text') { ?>
<a href="<?php echo JURI::base(); ?>" title="<?php echo $headline; ?>"><?php echo $headline;?></a>
<?php } ?>
</h1>


Now your files should be under templates/templatename/images/<Ref to $scheme>/en-GB/logo.png (replace en-GB with de-DE etc. where appropriate)
User avatar
ivo.apostolov
Contributor
 
Posts: 3248
Joined: Sat Oct 20, 2007 10:39 am
Location: Sofia

Re: Header images languages selection

Postby formulador on Thu Jul 31, 2008 2:27 pm

Great, Ivo
It works perfectly
Thank you
Samuel
formulador
Newbee
 
Posts: 11
Joined: Wed Jun 25, 2008 9:25 pm


Return to Beta, Beta 2 and prior version bugs

Who is online

Users browsing this forum: Bing [Bot] and 1 guest