backdrop-contrib / gin

Admin theme with a strong focus on improving the Editorial Experience.
https://backdropcms.org/project/gin
GNU General Public License v2.0
5 stars 2 forks source link

Sidebar below edit form when using multiple languages #59

Closed mrlch closed 6 months ago

mrlch commented 11 months ago

I reported in a previous issue that the sidebar is on some installations at the wrong place.

Now I know what causes the issue.

When I install a second language the sidebar moves down.

Editform with only one language installed Bildschirmfoto 2023-09-13 um 17 14 39

Adding second language Bildschirmfoto 2023-09-13 um 17 15 02

Sidebar at the wrong place Bildschirmfoto 2023-09-13 um 17 15 22

go back to one language Bildschirmfoto 2023-09-13 um 17 19 22

Edit form is back at the right place Bildschirmfoto 2023-09-13 um 17 20 57

laryn commented 11 months ago

@mrlch Can you provide specific steps to reproduce this on a fresh vanilla installation? I tried enabling another language and allowing multilingual options on a content type, but it doesn't cause the same issue:

CleanShot 2023-09-14 at 19 20 52@2x
laryn commented 8 months ago

I wonder if you have a contrib module that's breaking some things @mrlch -- which contrib modules do you have enabled?

olafgrabienski commented 7 months ago

Today I've encountered the issue with the sidebar moved below the editor on a new multilingual site I'm building. To reproduce the issue, I've set up a fresh demo site, installed the same modules and used the same multilingual options. At first sight without luck, but then I found the thing which makes the difference: a path prefix like en or de.

If you have enabled URL language detection at admin/config/regional/language/detection/url to use a path prefix for one or more languages, the path for adding a page will be something like de/node/add/page. In this case, the sidebar moves below the editor.

To verify the difference, leave the default language without path prefix and add a page using the path node/add/page. Now the sidebar should behave as expected.

olafgrabienski commented 7 months ago

When I compare the Create page form in the browser dev tools, it looks like the form with the sidebar issue is missing some styles from gin/dist/css/components/edit_form.css. On a form where the sidebar moves below the editor, the CSS definitions around line 40, 103 and 117 are missing.

olafgrabienski commented 6 months ago

@mrlch and @laryn, I'm curious if you can confirm my findings from two weeks ago:

If you have enabled URL language detection at admin/config/regional/language/detection/url to use a path prefix for one or more languages, the path for adding a page will be something like de/node/add/page. In this case, the sidebar moves below the editor.

laryn commented 6 months ago

@olafgrabienski I haven't had a chance to verify but it looks like helpful steps to test -- I'll let you know as soon as I'm able to give it a try.

laryn commented 6 months ago

@mrlch @olafgrabienski I've made a commit that should take care of this -- thanks for the report and the steps to reproduce! If the fix I've added doesn't solve it for you let me know, but it was all that was needed in my testing to make sure we didn't consider the language code as part of the URL when checking if we were editing a page.

olafgrabienski commented 6 months ago

@laryn I've tested the commit on one of my sites, and it fixes the issue for me. Thank you!