VISIT AND LIKE OUR PAGE ON FACEBOOK
TAKE A LOOK AT OUR TWEETS ON TWITTER
SUBSCRIBE TO THE JOOMFREAK RSS FEED
VISIT OUR CHANNEL ON YOUTUBE

Account Details

Change your name, email, password or permanently delete your account. Change settings

We offer several ways you can get support from our experts: Support ForumKnowledgebaseNewsletter

Your Forum Posts

No posts to display.

Welcome, Guest
Username Password: Remember me

Different banner with language template
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Different banner with language template

Different banner with language template 21 Jan 2015 06:57 #6134

If there are different language options for the template, how do you set the slideshow's background image according to language? Below is the code that controls the background image of "jf_calla-exteriors".

"css/template.css"

/* SLIDESHOW */
#jf-slideshow_en, #jf-slideshow {
background-image: url(../images/banner.jpg);

  • Posts:1
  • sda123
  • Fresh Boarder
  • OFFLINE
  • Karma: 0

Re: Different banner with language template 22 Jan 2015 05:19 #6141

templates/jf_calla-exteriors/index.php, modify to
 
<?php
$lang = JFactory::getLanguage();
$lang = substr($lang->getTag(), 0, 2);
?>
<div id="jf-slideshow" class="jf-slideshow_<?php echo $lang; ?>">
<div class="main clearfix">
...
</div>
</div>
 

templates/jf_calla-exteriors/css/template.css, insert
 
#jf-slideshow.jf-slideshow_en {
background-image: url(../images/banner.jpg);
}
 


joomfreak
Last Edit: 22 Jan 2015 05:20 by isupport.

  • Posts:2940
  • isupport
  • Moderator
  • OFFLINE
  • Karma: 0

Re: Different banner with language template 22 Jan 2015 06:14 #6142

After I changed from

#jf-slideshow_en, #jf-slideshow {

into

#jf-slideshow.jf-slideshow_en {

I don't see any background image on all languages site.

Any ideas?

  • Posts:1
  • y_pat
  • Fresh Boarder
  • OFFLINE
  • Karma: 0

Re: Different banner with language template 23 Jan 2015 02:18 #6146

First, you modify templates/jf_calla-exteriors/index.php from:
 
<div id="jf-slideshow">
<div class="main clearfix">
 
</div>
</div>
 

to:
 
<?php
$lang = JFactory::getLanguage();
$lang = substr($lang->getTag(), 0, 2);
?>
<div id="jf-slideshow" class="jf-slideshow_<?php echo $lang; ?>">
<div class="main clearfix">
 
</div>
</div>
 

Second, go to templates/jf_calla-exteriors/css/template.css, add (not change)
 
#jf-slideshow.jf-slideshow_en {
background-image: url(../images/banner.jpg);
}
 


joomfreak

  • Posts:2940
  • isupport
  • Moderator
  • OFFLINE
  • Karma: 0
  • Page:
  • 1
Time to create page: 0.85 seconds
Sunday 06 October 2024

joomfreak is not affiliated with or endorsed by the Joomla Project or Open Source Matters.
The Joomla logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.