Motivation
For canvas routes we want to render the editorial preview the LupusCSR theme, so we have a proper preview with header/footer.
Lupus-CSR changes things for the recently added "Lupus Decoupled" theme switching support, this needs to be re-considered.
The theme switching support is a bit confusing when we have both Lupus CSR and again different themes. Moreover, forms rendered in canvas pages or layout-builder pages won't get the overridden theme, so the feature is flawed and should be reverted.
Proposed resolution
- Improve custom_elements Nuxt preview-provider to re-use existing nuxt-app from CSR
- Allow custom elements preview providers to declare Lupus-CSR support, providing the replacements.
- Make LupusCSR configurable - Default to CSR using the frontend-server. Optionally, allow "Custom" config with a form for the metadata or with the preview-provider.
- Make the setting about theme switching canvas only
- Revert / undo theme switching for form routes
Issue fork lupus_decoupled-3577107
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fagoThinking more about this, we cannot easily do this. We'd have to merge the canvas scripts into whatever SPA is in the frontend. We clearly don'T want to go there, since this is never a robust solution.
So instead, we accept that canvas routes need to work differently - with a regular Drupal theme like Stark. Maybe it's even not too bad, since the user won't see header/footer that is not editable in canvas anyway. If people want edit header/footer regions, a custom theme would have to be provided for that, which provides those regions + the nuxt-app/ce-api would have to integrate that. then this would again work with both CSR and preview rendering. Summing up, this seems to be the better approach.
So what remains todo here is un-doing the support for route-based theme-overrides for form rendering, since this won't work reliably with varying frontend themes in canvas and CSR. If we need to adjust form-templates, a module doing that generally seems to better situated.
Comment #3
fagoComment #4
fagoComment #6
fagoImplemented and merged.