The Joomla! Forum ™






Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Fri Dec 11, 2009 9:44 am 
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 25, 2005 1:51 pm
Posts: 285
How to switch the template to right to left ?

to support right to left languages.

_________________
Joomla needs our help ... to the freedom .. live your life as you like but help as much as you can.


Top
 Profile  
 
PostPosted: Fri Dec 11, 2009 11:37 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10784
Location: Ireland
Hi,

you can use a something like this to load a different style sheet:
Code:
<?php  if($this->direction == 'rtl') : ?>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template_rtl.css" type="text/css" />
<?php endif; ?>


In the css file you can use the following css rule:
Code:
body{
   direction: rtl;
}


Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Fri Dec 11, 2009 12:11 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 25, 2005 1:51 pm
Posts: 285
First one to add in template index file, and second to add in style sheet of the template right?

For style sheet I need to add new style sheet... please explain more...

I need to keep use English and right to left languages in same site i am using " JoomFish2.0.4"

Thanks.

_________________
Joomla needs our help ... to the freedom .. live your life as you like but help as much as you can.


Top
 Profile  
 
PostPosted: Fri Dec 11, 2009 1:27 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10784
Location: Ireland
Hi,

yes, that is not a problem.
  1. create a file called templates/[your-template]/css/template_rtl.css
  2. place the following css rule in that file:
    Code:
    body{
       direction: rtl;
    }
  3. add other rtl specific stlyes if needed
  4. open your template's index.php file
  5. find the following line:
    Code:
    </head>
  6. and replace it with the following code:
    Code:
    <?php  if($this->direction == 'rtl') : ?>
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template_rtl.css" type="text/css" />
    <?php endif; ?>
    </head>

Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Fri Dec 11, 2009 10:45 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 25, 2005 1:51 pm
Posts: 285
Thanks for the help,

Do you mean add after or replace ?

replace mean remove the " </head> " code

_________________
Joomla needs our help ... to the freedom .. live your life as you like but help as much as you can.


Top
 Profile  
 
PostPosted: Sat Dec 12, 2009 4:30 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10784
Location: Ireland
Just add it the additional code in front of the </head> tag.

Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Sun Dec 13, 2009 4:26 am 
Joomla! Explorer
Joomla! Explorer

Joined: Thu Aug 25, 2005 1:51 pm
Posts: 285
I have added it, but unfortunately nothing happen.

When switching the language it dose not switch to left to right.

_________________
Joomla needs our help ... to the freedom .. live your life as you like but help as much as you can.


Top
 Profile  
 
PostPosted: Sun Dec 13, 2009 8:44 am 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 16668
Location: **Translation Matters**
1. Your language xml should contain the tag
<rtl>1</rtl>
2. Your template_rtl.css needs more than just body set to rtl direction. It also needs in quite a few places an align: right and changes in the margins/padding
I suggest you have a look at the default rtl.css files for milkyway.

It loas the ltr css + adds the rtl when necessary (i.e. when called by the language tag)
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/template.css" type="text/css" />
[...]
<?php if($this->direction == 'rtl') : ?>
<link href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/template_rtl.css" rel="stylesheet" type="text/css" />
<?php endif; ?>

As the rtl css is loaded AFTER the ltr css, the modified css will take precedence.

_________________
Jean-Marie Simonet / infograf · http://www.info-graf.fr
Multilanguage in 2.5: http://help.joomla.org/files/EN-GB_multilang_tutorial.pdf
---------------------------------
Joomla Translation Coordination Team • Joomla! Production Working Group


Top
 Profile  
 
PostPosted: Sun Apr 11, 2010 6:42 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Mar 10, 2010 7:38 am
Posts: 26
hi

i need your help how can i change rt_crystalline_j15 to RTL?

i want change joomla rt_crystalline_j15 to RTL ???

how to do that can somebody help pls??

Image

This template is difficult than all other template for changing to RTL


Top
 Profile  
 
PostPosted: Mon Nov 07, 2011 5:32 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Jul 31, 2009 7:27 am
Posts: 155
Location: Negombo, SL
Hi All,

I have go through above steps but I couldn't do this in correct way. It didn't switched and convert to RLT. I'm using Arabic as my second language in my site and I need to convert it to RTL.

It's better if any one can upload a sample file including index.php, language files and important areas highlighted.

Thaks,

_________________
LakiDM
http://www.webrubix.com


Top
 Profile  
 
PostPosted: Thu Jul 26, 2012 11:42 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Jun 27, 2012 10:17 am
Posts: 3
This works for me but my menu still reading from default CSS is there a way to fix the menu? because now its on the right side but text still LTR


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 



Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group