✨ UVE: Allow defining a default container
Problem Statement
When a user creates a new row in the layout editor, the "System Container" is automatically added. The "System Container" allows the addition of any content type, which clutters the drag-and-drop panel with a long list of options (approximately 30 content types for a basic setup), making it difficult for users to find the content they need.
https://github.com/user-attachments/assets/3829056f-9d4d-4a1b-a9a7-adb696117bb4
Objectives
- Allow users to define a default container to be used when a new row is added.
- Provide the option to have no container added by default.
- Ensure that the default behavior can be configured via an environment variable to avoid impacting existing users.
User Story
As a content editor, I want to be able to define which container is added by default when I create a new row, so I can have a cleaner and more efficient content editing experience.
Acceptance Criteria
- [ ] An environment variable is available to specify the default container.
- [ ] If the environment variable is set, the specified container is added when a new row is created.
- [ ] If the environment variable is not set, the "System Container" will be added by default to maintain backward compatibility.
- [ ] If the environment variable is set to a null or blank value, no container is added by default.
- [ ] The user should be able to manually add any container, including the "System Container," regardless of the default setting.
External Links
No response
Assumptions & Initiation Needs
- Access to modify environment variables is required to configure the default container.
Quality Assurance Notes & Workarounds
- QA should test the functionality with the environment variable set to a specific container, not set, and set to a blank value to ensure all scenarios work as expected.
Potential Challenges
- Ensuring the new environment variable is properly documented for all users.
- Managing the transition for existing users who may be accustomed to the current behavior.
Keepping original content
Define the Problem
We automatically add the System container when you create a row. This is only good if someone uses dotCMS as a PURE headless solution, which is not the primary use case for dotCMS. We should only automatically add the System Container if no other container exists.
Who's Facing the Problem?
Adding the System Container makes UVE difficult because it allows users to add any and all content types. This makes the drag-n-drop panel extremely long ~30 content types for even the most basic setup.
Screenshot or Video
With the System Container being added:
With Just The Default Container:
Relevant Links and Resources
No response
Assumptions & Initiation Needs
No response
Here’s a cleaned-up and more readable version of your QA note:
Note to QA
You can configure the default container using the Overrides configuration in the Maintenance screen.
Steps to set the DOT_DEFAULT_CONTAINER
- Log in to dotCMS
- Navigate to Settings > Maintenance > System Info
- Scroll to the end of the page
- Add or edit the
DOT_DEFAULT_CONTAINERin Configuration Overrides
Note: This variable requires the title of the container as its value.
Scenarios to test
- If the variable is not set, the default container in the Template Builder should be
SYSTEM CONTAINER. - If the variable is set to null or an empty string, there should be no default container in the Template Builder.
- If the variable is set to a valid container title, that container should be used as the default.
Edge Case
- If multiple containers share the same title (possible in some cases), the system will use the first match it finds (usually the most recently created). This behavior has been approved by @fmontes.
Documentation
We also need to document this behavior. cc: @jdcmsd
QA PASSED
These are the scenarios tested, all of them have passed successfully:
- No affectation, when the environment variable
DOT_DEFAULT_CONTAINERis not set. Expected: Default container is System Container. - Change the env variable to a valid container name in lowercase. Expected: Default container is the corresponding container selected in the environment variable.
- Change the env variable to a valid container name in UPPERCASE. Expected: Default container is the corresponding container selected in the environment variable.
- Change to an INVALID container name. Expected: Default container is no default container.
- Change to a void name from the BE. Expected: Default container is no default container.
- Create a new page to see if it is using the container set in the environment variable. (It depends in the layout used in the page). Expected: Default container is the corresponding container selected in the environment variable.
