Project

General

Profile

Actions

Feature #90444

open

Nested grids in content elements are possible after Fluid-based rewrite of page layout module

Added by Claus Due about 4 years ago. Updated about 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Start date:
2020-02-19
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

After the page layout module has been rewritten and based on Fluid it has become feasible to provide a nested grid feature for content elements, allowing other content elements to be placed inside a grid below a parent content element.

The structure and relationships can be implemented as follows:

  • First of all, a feature flag can be used which is disabled by default, requiring the site administrator to enable the feature to use it.
  • Table backend_layout can have a toggle which defines that a layout is (also) valid for use with content elements.
  • Table backend_layout can have a field which allows selecting CTypes that can use the backend_layout as nested grid.
  • PageTSconfig can have the same two settings so the backend_layout TS array can define the same two options except through pageTSconfig.
  • Table tt_content can have a field that allows selecting a backend_layout identifier (either from records or pageTSconfig), the field only showing layouts 1) marked for use with content and 2) allowed for the current record's CType.
  • Class BackendLayoutView can allow resolving a backend_layout (record or TS config or third party) for a record fitting the above criteria.

Then the feature for backend UI can be implemented as follows:

  • The new GridColumnItem class can resolve a backend_layout for a record through BackendLayoutView.
  • If resolved, the BackendLayout can provide a Grid instance.
  • That Grid instance which holds GridRows GridColumns contains the colPos values (0-99) that apply to each column.
  • When resolved for a record the colPos values can be adjusted (by multiplying the parent element UID by 100 and adding the original colPos value to that, creating colPos values like 12301 for colPos 1 inside element with uid 123).
  • The grid is then rendered with dropzones and new content buttons like any other backend_layout.
  • The page-level backend layout ContentFetcher already selects content by pid and therefore stores all elements that should be rendered; the sub-columns can fetch from ContentFetcher without additional queries.

This together allows editing the page layout module to insert child content.

Then a DataHandler modification can be implemented as follows:

  • Simple commands (delete, undelete, localize) can be performed by simply cascading the same command to all child records by selecting content based on columns of the parent record, when a parent record is deleted, undeleted or localized.
  • A move command can be cascaded as well but may require adjusting the pid and has to happen in the special section dealing with "move" commands.
  • A copy command is the most complex and must be handled by cascading copy commands and overriding certain values (colPos needs to be adjusted to UID of copied parent record when child records are copied).

Put together this creates the entire "nested content grids" feature.

Actions

Also available in: Atom PDF