Open parsfounder opened 3 years ago
Just source for info on how to do it easy way:
https://getbootstrap.com/docs/5.0/getting-started/rtl/
@Jimmi08 I prefer to have this feature as an option in admin area.
@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');
}
@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 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.
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.
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.
Going to reopen this because it needs some enhancements in core
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
Persian, Hebrew, Arabic languages are in RTL format so it is really needed to have this feature.