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

Loss of Device-Specific Content When Modifying a Container Page in OpenCms #809

Open
rgaviras opened this issue Nov 7, 2024 · 0 comments

Comments

@rgaviras
Copy link
Contributor

rgaviras commented Nov 7, 2024

We are using a template with resources that include Nested Containers to create a dynamic grid in our Container Pages (e.g., TemplateRows or LayoutRows, which are structures used to flexibly organize and arrange content). We have encountered an issue when designing different layouts for desktop and mobile, using the device-dependent design functionality described in the OpenCms documentation:

Device-Dependent Design in OpenCms Documentation

The problem is that if we create a specific container structure for desktop and another one for mobile within the same container page, any subsequent modification only saves the containers visible in the view being edited. This can be desktop, mobile, or tablet. Elements not visible in that view are lost upon saving.

Apparently, OpenCms only saves in the Container Page the elements that are loaded in the active memory, ignoring those that are hidden at that moment due to the device configuration.

Steps to Reproduce:

  1. Apply a template provider in the format: provider=org.opencms.loader.CmsDefaultTemplateContextProvider,template=/uri/of/your/template.jsp

  2. Dynamically create two resources that generate containers such as Layout Rows, and add different content to each of them.

  3. Configure one of the containers to display only on mobile devices and the other one only on tablets.

At this point, the behavior is as expected: if accessed from a desktop device, one container is displayed; if accessed from a mobile device, the other container is displayed.

  1. Edit any element of the Container Page from the desktop or mobile view.

Upon doing this, the contents of the opposite view disappear, as only the elements visible in the current editing view are saved.

This issue has been reproduced in several versions of OpenCms, from at least version 10.5.4 up to version 18, and can easily be tested in the demo environment.

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

No branches or pull requests

1 participant