How do I change the theme format immediately from right to left and The reverse(left to right)?

Hi there
I use the English and Persian language.
I can easily change the template css from right to left or left to right.
but I have a problem with the web cache.
How do I change the format immediately(online) from right to left and The reverse?
Should I clear the cache?
or should I use IS?

  • I'm also interest in this, I've turned off simple cache, which works, but probably isnt the best solution.

  • Sadra Borzouei

    thanks dear susan ,yes you are right. I've turned off simple cache too, in

  • How have you created the RTL theme? How are you telling your site whether it should use the RTL of LTR theme?

  • @Juho in elgg 1.8.19 I'm using a custom version of Aalborg theme, have added a css directory inside the theme called aalborg_theme_rtl and call it from Aalborg start.php using some lines from an elgg 1.7.1 plugin (if users chosen language is English the ltr is called, otherwise the rtl is called

    //elgg_extend_view('css/elgg', 'aalborg_theme/css');

    if (function_exists('elgg_extend_view') || function_exists('extend_view')){
                // As we see form the elgglib.php file in the elgg_extend_view() function, the views are saved in this array
                // Having our plugin run last means we can reset the array and then just use our own CSS file to extend the view
                if (isset($CONFIG->views->extensions['css'])){
                    // Clearing the actual array of views
                    $CONFIG->views->extensions['css'] = array();
        // Adding our CSS file. Add all your CSS to the {ELGG_ROOT}/mod/x/views/default/x/css.php file
                if (function_exists('elgg_extend_view') && $current_lang_id != 'en'){
                    //elgg_extend_view('css', 'x/css');
                    elgg_extend_view('css', 'aalborg_theme_rtl/css');
                } else if (function_exists('elgg_extend_view')) {
                     elgg_extend_view('css', 'aalborg_theme/css');

  • Sadra Borzouei

    Hi thanks dear friends
    @Juho I change some codes in css (element folder) then used this codes in start.php and elgg.php

    start.php(in theme) :

    $lan_id = get_current_language();

    if ($lan_id == 'fa'){
    elgg_extend_view('css/elgg', 'themename/css_RIGHT');

    }elseif($Lan_id == 'en'){

    elgg_extend_view('css/elgg', 'themename/css');

    in elgg.php :

    $lan_id = get_current_language();
    if ($lan_id == 'fa'){

    echo elgg_view('css/elements/layout_RIGHT', $vars);
    echo elgg_view('css/elements/typography_RIGHT', $vars);
    echo elgg_view('css/elements/navigation_RIGHT', $vars);
    echo elgg_view('css/elements/modules_RIGHT', $vars);

    }elseif($lan_id == 'en'){

    echo elgg_view('css/elements/layout', $vars);
    echo elgg_view('css/elements/typography', $vars);
    echo elgg_view('css/elements/forms', $vars);
    echo elgg_view('css/elements/navigation', $vars);

    thanks .i used in

  • Currently you're overriding the default CSS so the cache has either RTL of LTR version, but never both.

    Instead of overriding the CSS, you could use elgg_register_css() to register the RTL CSS and then call it with elgg_load_css() in case the logged in user is using a RTL language. That way the the default CSS gets loaded on every page and RTL CSS if user's language requires it.

    (We should really get better RTL support to core...)