Skip to content

[TASK] Content Drive: dynamic table columns from content type "Show In List" fields #36736

Description

@zJaaal

Description

Part of epic #33280 (Select columns to show on table).

Make the Content Drive results table support extra, dynamic columns on top of its fixed set (name, status, locale, type, edited-by, last-edited, actions).

For the Content Drive context: when a single content type is selected in the filters, the extra columns are that content type's "Show In List" fields (field.listed === true), inserted right after the Type column. They follow the selected content type automatically — no manual picking. With multiple/no content type selected, only the fixed columns show.

Note: this delivers the epic's goal via a different solution than the epic's original "context-menu picker" note — columns are derived from the content type's Show In List fields, reusing the field data we already fetch for User Searchable.

Approach

1. Splice a dynamic columns block into the table — libs/portlets/dot-content-drive/ui/src/lib/dot-folder-list-view/

  • Only the Show In List columns are dynamic — keep every fixed column exactly as it is today (header entries + the hand-written <tbody> cells with their custom rendering). No full table generalization; this keeps things simple.
  • Add an extraColumns input and render it as a block inserted immediately after the Type (contentType) column, in both the header and the body:
    • Header: emit the extra column headers right after the Type <th>.
    • Body: right after the Type <td>, @for over the extra columns rendering the field value generically (e.g. item[column.field] with a default renderer).
    • Skeleton: same insertion so the loading row matches.
  • Update the hardcoded colspan / SKELETON_SPAN to include the extra-column count. Widths: the extra columns take their own space after Type (fixed-layout percentages may need a light rebalance).

Per the table's original design it's already set up to accommodate this — the change is a localized insertion after the Type column, not a rewrite.

2. Derive Content Drive extra columns from "Show In List" fields

  • Reuse the field fetch built for User Searchable: single-selected-content-type detection ($activeContentType) + DotContentTypeService.getContentType(variable) — the response already returns every field, so no extra request is needed.
  • Filter with field.listed (instead of the User Searchable searchable && indexed predicate) to get the Show In List fields.
  • Expose them on the store (e.g. a showInListFields signal alongside userSearchableFields) and pass them to the table as extraColumns.

Acceptance Criteria

  • dot-folder-list-view accepts an extraColumns input and renders those columns after the Type column (header, body, skeleton all in sync).
  • Fixed columns are unchanged — they keep their hardcoded custom rendering (thumbnail, status, locale, relative date, actions).
  • colspan / skeleton span account for the extra columns (no hardcoded mismatch).
  • In Content Drive, selecting a single content type adds that type's Show In List (listed) fields as extra columns.
  • Selecting multiple content types or none shows only the fixed columns.
  • The column set updates reactively when the selected content type changes (and clears with the filter).

Technical Notes

  • Table: libs/portlets/dot-content-drive/ui/src/lib/dot-folder-list-view/ — columns array HEADER_COLUMNS and DotFolderListViewColumn in .../ui/src/lib/shared/{constants,models}.ts. Header/skeleton already loop the array; the <tbody> cells and colspan are the parts to touch.
  • Show In List flag: DotCMSContentTypeField.listed — libs/dotcms-models/src/lib/dot-content-types.model.ts.
  • Field fetch to reuse: dot-content-drive-field-filter-menu.component.ts ($activeContentType, getContentType().fields, per-type cache) + store signals in dot-content-drive.store.ts (userSearchableFields, setUserSearchableFields, clearUserSearchableFilters). Add a parallel Show-In-List path off the same fetch.

Out of Scope

  • Manual column selection / column-picker UI (the epic's original framing).
  • Creating or defining new columns or fields.
  • Persisting column preferences per user.
  • Extra columns for contexts other than Content Drive (the table stays agnostic; only the Content Drive derivation is in scope here).

Additional Context

Epic: #33280

Activity

  1. added theissue type on Jul 27, 2026
  2. self-assigned this
    on Jul 27, 2026
  3. moved this from New to In Progress in dotCMS - Product Planningon Jul 27, 2026
  4. github-actions commented on Jul 27, 2026

    @github-actions
    Contributor
  5. moved this from In Progress to In Review in dotCMS - Product Planningon Jul 27, 2026
  6. removed their assignment
    on Jul 28, 2026
  7. moved this from In Review to QA in dotCMS - Product Planningon Jul 28, 2026
  8. self-assigned this
    on Jul 28, 2026
  9. dario-daza commented on Jul 29, 2026

    @dario-daza
    Member

    ✅ PASSED QA:

    QA-content-drive-show-list.mov

    Note For the Custom Field:

    Tested a Custom Field with "Show in List" enabled, using Default Value = #set($x="Hello")$x.

    Result: Content Drive's column shows the literal raw text #set($x="Hello")$x, not the evaluated Hello.

    Confirms: Content Drive never evaluates Velocity for any field — it only displays the raw, already-stored per-contentlet value. A Custom Field's "Value" box (the code editor) is Velocity source used only in specific render contexts (e.g. page/container rendering, edit-content iframe widgets) and is never stored per-contentlet or shown in Content Drive; only "Default Value" seeds the actual stored value that list/browse views display.

    This is not a Content Drive defect, it's expected behavior given how Custom Field is designed.

  10. removed their assignment
    on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions