How to switch the template to right to left ?
Moderator: General Support Moderators
-
- Joomla! Explorer
- Posts: 285
- Joined: Thu Aug 25, 2005 1:51 pm
- Contact:
How to switch the template to right to left ?
How to switch the template to right to left ?
to support right to left languages.
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.
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: How to switch the template to right to left ?
Hi,
you can use a something like this to load a different style sheet:
In the css file you can use the following css rule:
Olaf
you can use a something like this to load a different style sheet:
Code: Select all
<?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; ?>
Code: Select all
body{
direction: rtl;
}
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 285
- Joined: Thu Aug 25, 2005 1:51 pm
- Contact:
Re: How to switch the template to right to left ?
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.
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.
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: How to switch the template to right to left ?
Hi,
yes, that is not a problem.
yes, that is not a problem.
- create a file called templates/[your-template]/css/template_rtl.css
- place the following css rule in that file:
Code: Select all
body{ direction: rtl; }
- add other rtl specific stlyes if needed
- open your template's index.php file
- find the following line:
Code: Select all
</head>
- and replace it with the following code:
Code: Select all
<?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 Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 285
- Joined: Thu Aug 25, 2005 1:51 pm
- Contact:
Re: How to switch the template to right to left ?
Thanks for the help,
Do you mean add after or replace ?
replace mean remove the " </head> " code
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.
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: How to switch the template to right to left ?
Just add it the additional code in front of the </head> tag.
Olaf
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 285
- Joined: Thu Aug 25, 2005 1:51 pm
- Contact:
Re: How to switch the template to right to left ?
I have added it, but unfortunately nothing happen.
When switching the language it dose not switch to left to right.
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.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: How to switch the template to right to left ?
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.
<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
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 26
- Joined: Wed Mar 10, 2010 7:38 am
Re: How to switch the template to right to left ?
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??
This template is difficult than all other template for changing to RTL
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??
This template is difficult than all other template for changing to RTL
-
- Joomla! Enthusiast
- Posts: 155
- Joined: Fri Jul 31, 2009 7:27 am
- Location: Negombo, SL
- Contact:
Re: How to switch the template to right to left ?
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,
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,
-
- Joomla! Fledgling
- Posts: 3
- Joined: Wed Jun 27, 2012 10:17 am
Re: How to switch the template to right to left ?
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
-
- Joomla! Enthusiast
- Posts: 142
- Joined: Sat Apr 28, 2012 3:20 pm
Re: How to switch the template to right to left ?
when I did this, it worked. however, everything at the back end is not working any more. any clue ?
I can not edit, add article work with modules or anything at all. it's weird
I can not edit, add article work with modules or anything at all. it's weird