You are viewing the PKP Support Forum | PKP Home Wiki

change direction of pages

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

change direction of pages

Postby sam79 » Mon Nov 13, 2006 1:02 am

I want to set the direction of pages to "rtl" insted of "ltr" for the write handed laguages, how can I do this?
please answer me as soon as possible
Posts: 1
Joined: Sun Nov 12, 2006 10:46 pm

Postby asmecher » Mon Nov 13, 2006 3:29 am

Hi sam79,

While nobody on the development team has specific BiDi (bi-directional) experience, OJS has been written with the capability in mind. OJS generally uses the UTF-8 character encoding, which supports RTL, LTR, and mixed (BiDi) content. In addition to this, you may want to create a custom CSS stylesheet to format parts of OJS as necessary. If you find that it's still necessary to add additional mark-up (e.g. HTML's "dir" attribute) to OJS's templates, please let us know as we'd be interested in facilitating the use of RTL languages.

Alec Smecher
Open Journal Systems Team
Posts: 9703
Joined: Wed Aug 10, 2005 12:56 pm

Separate stylesheet for each Locale

Postby msaghaei » Mon May 07, 2007 6:03 am

Hi Alec

For many rtl languages such as Farsi, I think it is not only necessary to change the page direction, but also a handfull of extra settings may be necessary to display the page in the correct way. These extra settings may include some extra spaces ( ) between navigation menu items, changing the font faces and sizes, altering margins and paddings, changing the float attribute of sidebar to other side, exchanging majority of lefts with rights in css files. So if these configurations are included in the 'journalStyleSheet.css' file (or other stylesheets), this may cause inappropriate rendering of English pages. So a solution may be to have different stylesheet files loaded per language. One way to come with this is to upload manually the stylesheets of the languages other than English into the public/journals/jounal_id folder on the server and changing its name to journalStyleSheet_ + code for loacale (e.g. es_ES, or fa_IR) + .css. Then we can add somthing to the TemplateManager.inc.php to read this style sheet instead of the main stylesheet. A sample code may be placed after:
Code: Select all
// Assign stylesheet and footer
$journalStyleSheet = $journal->getSetting('journalStyleSheet');

such as:
Code: Select all
$curLocExt = Locale::getLocale();
if ($curLocExt != "en_US") $journalStyleSheet['uploadName'] = str_replace("journalStyleSheet.css", "journalStyleSheet_{$curLocExt}.css", $journalStyleSheet['uploadName']);

Please visit the site of 'Journal of Research in Medical Sceicnes' to see a sample of separate sheets for each locale.

Posts: 119
Joined: Sun Jan 08, 2006 1:01 pm

Re: Direction in OCS

Postby esoolam » Sat Aug 18, 2007 10:26 pm

Hi asmecher
I want to load the css file manualy in ocs and tried the above solution ,but didn't work. Shoud the code to change more or the suloltion is complete? (i changed the 'jornal' with 'conference' in the code)
Posts: 5
Joined: Wed Aug 01, 2007 1:56 am

Re: change direction of pages

Postby asmecher » Sun Aug 19, 2007 8:43 am

Hi esoolam,

For OCS 2.0, something like the above (with "conference" in place of "journal") should work if you add it just under the following line in classes/template/TemplateManager.inc.php:
Code: Select all
$conferenceStyleSheet = $conference->getSetting('conferenceStyleSheet');
Alec Smecher
Public Knowledge Project Team
Posts: 9703
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests