How to switch the template to right to left ?

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

Moderator: General Support Moderators

Locked
mbd
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Thu Aug 25, 2005 1:51 pm
Contact:

How to switch the template to right to left ?

Post by mbd » Fri Dec 11, 2009 9:44 am

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.

User avatar
ooffick
Joomla! Master
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 ?

Post by ooffick » Fri Dec 11, 2009 11:37 am

Hi,

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; ?>
In the css file you can use the following css rule:

Code: Select all

body{
	direction: rtl;
}
Olaf
Olaf Offick - Global Moderator
learnskills.org

mbd
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Thu Aug 25, 2005 1:51 pm
Contact:

Re: How to switch the template to right to left ?

Post by mbd » Fri Dec 11, 2009 12:11 pm

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.

User avatar
ooffick
Joomla! Master
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 ?

Post by ooffick » Fri Dec 11, 2009 1:27 pm

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: Select all

    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: Select all

    </head>
  6. 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
Olaf Offick - Global Moderator
learnskills.org

mbd
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Thu Aug 25, 2005 1:51 pm
Contact:

Re: How to switch the template to right to left ?

Post by mbd » Fri Dec 11, 2009 10:45 pm

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.

User avatar
ooffick
Joomla! Master
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 ?

Post by ooffick » Sat Dec 12, 2009 4:30 pm

Just add it the additional code in front of the </head> tag.

Olaf
Olaf Offick - Global Moderator
learnskills.org

mbd
Joomla! Explorer
Joomla! Explorer
Posts: 285
Joined: Thu Aug 25, 2005 1:51 pm
Contact:

Re: How to switch the template to right to left ?

Post by mbd » Sun Dec 13, 2009 4:26 am

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.

User avatar
infograf768
Joomla! Master
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 ?

Post by infograf768 » Sun Dec 13, 2009 8:44 am

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
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

abdullah2010
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Wed Mar 10, 2010 7:38 am

Re: How to switch the template to right to left ?

Post by abdullah2010 » Sun Apr 11, 2010 6:42 am

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

lakma
Joomla! Enthusiast
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 ?

Post by lakma » Mon Nov 07, 2011 5:32 am

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,

police01049
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Jun 27, 2012 10:17 am

Re: How to switch the template to right to left ?

Post by police01049 » Thu Jul 26, 2012 11:42 am

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

wizarddesign
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 142
Joined: Sat Apr 28, 2012 3:20 pm

Re: How to switch the template to right to left ?

Post by wizarddesign » Mon Jul 13, 2015 10:49 pm

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 :pop


Locked

Return to “Language - Joomla! 1.5”