When I open the content browser from the ckeditor button in a drupal instance that has a custom frontend theme, the content browser iframe opens using the frontend stylesheet, which in my specific case, makes it unusable.

Comments

k@p created an issue. See original summary.

k@p’s picture

StatusFileSize
new669 bytes

Actually, I found this is a routing issue, the module is altering route in ContentBrowserRouteSubscriber class for it not to use an admin route. I don't know why it was designed this way, but here is a patch for people who need to use an admin route to get the admin styles

samuel.mortenson’s picture

@k@p Thanks for the issue! I think this should definitely be configurable - the reason that frontend styles are used is that users usually have control over the look/feel (templates/CSS) of their frontend theme, and style view modes for their content types in there, not in the backend theme. That said, there are benefits to using the backend theme, especially in regards to form consistency.

samuel.mortenson’s picture

Status: Active » Needs review
StatusFileSize
new5.06 KB

@k@p Hello again, I've created a patch which makes rendering in the frontend theme configurable. I understand how this could feel odd to users so I've disabled it by default as well, for new installs only.

Would you be willing to test the patch out and see if it works for you? You'll need to apply it to your Content Browser install, rebuild caches, then visit /admin/config/content-browser/settings and save the form with the "Use frontend theme" checkbox unchecked. After that, Content Browser should be rendered with the appropriate theme.

Thanks!

oriol_e9g’s picture

StatusFileSize
new5.03 KB

Reroll

oriol_e9g’s picture

Version: 8.x-1.0-alpha4 » 8.x-1.x-dev
oriol_e9g’s picture

Status: Needs review » Needs work

IMO Content browser settings routing should be: admin/config/content/content_browser
Instead of admin/config/content-browser/settings
to be consistent with Entity browser settings admin/config/content/entity_browser

oriol_e9g’s picture

StatusFileSize
new5.04 KB
oriol_e9g’s picture

StatusFileSize
new5.03 KB

Sorry inverse patch.

oriol_e9g’s picture

StatusFileSize
new5.4 KB

Added missing content_browser.links.menu.yml for better module settings discoverability.

oriol_e9g’s picture

Status: Needs work » Needs review
evanmwillhite’s picture

It seems to me the standard for admin modules is that they use the admin theme. If someone wants control over the look/feel of that, then they create a custom version of the admin theme (or a subtheme of it if possible) in their project and override templates and styles there. In essence, this is controllable without making your frontend theme handle it. If you want to make it configurable for the developers, I guess that would be a plus. But I would recommend defaulting to the administrative theme based on this standard.

techninja’s picture

StatusFileSize
new5.5 KB

Rerolling patch from #10 on latest 8.x-1.x-dev

FWIW This definitely needs a cache clear between adjustments on the admin page, but I've verified this works.

samuel.mortenson’s picture

Anyone have time to review the most recent patch?

@evanmwillhite I think #3 explains why the default is the way it is. In theory defaulting to the admin theme is correct, but in practice very few sites I've worked on have any custom CSS in /admin. Maybe in a new major version we can change this.

kevinfunk’s picture

#13 applies to dev and I am able to switch between the front and admin theme.

kevinfunk’s picture

Status: Needs review » Reviewed & tested by the community
alphex’s picture

Can we get this patch rerolled against 1.1? And then, declared fixed for a later release?

kevinfunk’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new5.42 KB

Reroll