Load diff css / js files for plugin or module based on lang

General questions regarding the use of languages in Joomla! 2.5.

Moderators: infograf768, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
jiyuu19th
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Fri Jun 17, 2011 1:25 am
Contact:

Re: Load diff css / js files for plugin or module based on l

Post by jiyuu19th » Sun Dec 22, 2013 1:22 pm

thank a lot but it not work for me :'(
triveni1231 wrote:I want to add few custom fonts.

Triveni
you can use font face css in your site.
http://www.xn--22cap5dwcq3d9ac1l0f.com <= พื้นที่ให้เช่า พื้นที่เช่า

yohebon
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Tue Sep 03, 2013 5:15 am

Re: Load diff css / js files for plugin or module based on l

Post by yohebon » Wed Feb 26, 2014 4:06 am

pishro wrote:how i can add custom fonts language, CSS and JavaScript files to my template based on the Warp Framework ?
I had the same question. You can search for an answer here:

Code: Select all

http://www.yootheme.com/themes/documentation/customizing/add-new-css-js-or-fonts

bolobolojogja
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Dec 26, 2013 12:07 am
Location: Indonesia
Contact:

Re: Load diff css / js files for plugin or module based on l

Post by bolobolojogja » Sun May 25, 2014 9:30 am

jdran wrote:Well, I tried but I couldn't find a solution.

This is the code:

Code: Select all

<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
//get params
$tagline = $this->params->get('sitedescription');
JFactory::getDocument()->setGenerator('');
$lang = JFactory::getLanguage();
if ($lang->getTag() == 'el-GR') {
  JHtml::_('stylesheet', 'tdg/css/mySecondcss.css', array(), true);
}
  
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/cleanstickyfooter.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/default.css" type="text/css" />
</head>

<body>
    <div class="header">
      <div class="logo">
         <a href="index.php" title="Logo">
            <img class="badge" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.png" width="100px" height="100px" title="logo" alt="The logo" />
         </a>
            <div class="spec">
          
               <div class="sitename">
                  <?php echo $app->getCfg('sitename');?>
               </div><!--/sitename-->
      
               <div class='tagline'>
                 <?php echo $tagline; ?>
               </div><!--/tagline-->
            </div><!--/spec-->
      </div><!--/logo-->
       
  </div><!--/header-->
What I wanted to do is to have a different css in each language for the <spec> and only. That's why I asked what do I have to put after "else".
The problem is that I don't know how to substitute the "default.css" for the case that Greek language is turned on. I even tried different forms of the code JHTML::_ but it didn't seem to trigger anything.
wweewww....it's very very nice...and very absolutely..i hope the code can put on my web..thank yout


Post Reply

Return to “Language - Joomla! 2.5”