e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

RTL support #4545

Open parsfounder opened 3 years ago

parsfounder commented 3 years ago

Persian, Hebrew, Arabic languages are in RTL format so it is really needed to have this feature.

Jimmi08 commented 3 years ago

Just source for info on how to do it easy way: https://getbootstrap.com/docs/5.0/getting-started/rtl/

parsfounder commented 3 years ago

@Jimmi08 I prefer to have this feature as an option in admin area.

Jimmi08 commented 3 years ago

@2548ir For bootstrap3 theme: Try to add this define("TEXTDIRECTION", "rtl"); to init() of class theme in theme.php. If it fails (I tried it, something was changed) then you need special rtl.css in your theme. For example from here: https://github.com/morteza/bootstrap-rtl

It should be loaded thanks to this:

if(defined('TEXTDIRECTION') && file_exists(THEME . '/' . strtolower(TEXTDIRECTION) . '.css'))
{
    $e_js->themeCSS(strtolower(TEXTDIRECTION) . '.css');
}
parsfounder commented 3 years ago

@Jimmi08 I have downloaded the rtl.css file and copied to bootstrap3/css folder then I added the following line into custom tags (inside head tags) field in admin area but nothing was changed (cache cleared): <link rel="stylesheet" href="rtl.css" />

Jimmi08 commented 3 years ago

@Jimmi08 I have downloaded the rtl.css file and copied to bootstrap3/css folder then I added the following line into custom tags (inside head tags) field in admin area but nothing was changed (cache cleared): <link rel="stylesheet" href="rtl.css" />

it is not the correct way... wrong path and it should go to theme itself. Or try to use full path (or check console). And check if your tag has attribute dir="rtl" (TEXTDIRECTION should do this)

This should be part of the core theme. It was supported before. I didn't know that it is so easy or it was already on old version. Maybe you should reopen this.

parsfounder commented 3 years ago

The following lines fixed the issue:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-rtl.css">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-rtl.css.map">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-rtl.min.css">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-flipped.css">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-flipped.css.map">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-flipped.min.css">

It's good to have an option to activate RTL mode for those who don't know how to do this manually.

Jimmi08 commented 3 years ago

It would be a great example of how to use theme_library (to have CDN and local version). I don't know how to use it.

Moc commented 3 years ago

Going to reopen this because it needs some enhancements in core

parsfounder commented 2 years ago

Bootstrap3 RTL version is attached here: bootstrap-rtl-master.zip or it can be found via the following repository: https://github.com/morteza/bootstrap-rt