Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add right-to-left layout support #1769

Open
dur41d opened this issue Sep 24, 2018 · 3 comments
Open

add right-to-left layout support #1769

dur41d opened this issue Sep 24, 2018 · 3 comments

Comments

@dur41d
Copy link

dur41d commented Sep 24, 2018

Is your feature request related to a problem? Please describe.

Languages like Arabic, Persian, Hebrew, require right-to-left support for the admin layout.

Describe the solution you'd like

Enable right-to-left for the admin panel. This could be done:

  1. Via configuration so that it is always enabled. This could work well if the site is uni-lingual and the layout can be pre-determined to be right-to-left.
  2. Via a button on the admin panel that can switch the layout on demand. This is good for multi-lingual sites like English and Arabic which is common.
  3. Per collection so the user can define collections that are right-to-left which will also work well for multi-lingual sites.

I guess we can start with #1 and then increase the complexity of the support afterwards.

Describe alternatives you've considered

I tried putting dir="rtl" in the root html element of the admin page. but it didn't work well (see the screenshot below).

Additional context

09-24-2018 12-27-36 pm

@tech4him1
Copy link
Contributor

(WIP) CSS changes necessary to make this work:

@stale
Copy link

stale bot commented Oct 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: stale label Oct 29, 2019
@mehdisadeghi
Copy link

Perhaps below snippet could help someone. It partially forces RTL layout. Just add it to the admin page's index.html.

   <script>
    var PostPreview = createClass({
      render: function() {
        var entry = this.props.entry;
        var image = entry.getIn(['data', 'image']);
        var bg = this.props.getAsset(image) || '';
        return h('div', {'dir': 'rtl'},
          h('h1', {}, entry.getIn(['data', 'title'])),
          h('img', {src: bg.toString()}),
          h('div', {"className": "text"}, this.props.widgetFor('body'))
        );
      }
    });

    CMS.registerPreviewTemplate("posts", PostPreview);
    </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants