core icon indicating copy to clipboard operation
core copied to clipboard

✨ UVE: Allow defining a default container

Open fishsmith opened this issue 2 years ago • 3 comments

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.

fishsmith avatar Aug 29 '24 15:08 fishsmith

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: system-container

With Just The Default Container: default-container

Relevant Links and Resources

No response

Assumptions & Initiation Needs

No response

fmontes avatar Aug 18 '25 18:08 fmontes

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

  1. Log in to dotCMS
  2. Navigate to Settings > Maintenance > System Info
  3. Scroll to the end of the page
  4. Add or edit the DOT_DEFAULT_CONTAINER in Configuration Overrides

Note: This variable requires the title of the container as its value.

Image

Scenarios to test

  1. If the variable is not set, the default container in the Template Builder should be SYSTEM CONTAINER.
  2. If the variable is set to null or an empty string, there should be no default container in the Template Builder.
  3. 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

rjvelazco avatar Sep 16 '25 13:09 rjvelazco

QA PASSED

These are the scenarios tested, all of them have passed successfully:

  1. No affectation, when the environment variable DOT_DEFAULT_CONTAINER is not set. Expected: Default container is System Container.
  2. Change the env variable to a valid container name in lowercase. Expected: Default container is the corresponding container selected in the environment variable.
  3. Change the env variable to a valid container name in UPPERCASE. Expected: Default container is the corresponding container selected in the environment variable.
  4. Change to an INVALID container name. Expected: Default container is no default container.
  5. Change to a void name from the BE. Expected: Default container is no default container.
  6. 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.

dario-daza avatar Sep 18 '25 13:09 dario-daza