From c34e312274533d3ee78690767e1aab0d830a3a9d Mon Sep 17 00:00:00 2001 From: Lina Wolf <48202465+linawolf@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:54:27 +0200 Subject: [PATCH] [FEATURE] Add record list download presets (#529) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FEATURE] Add record list download presets References https://github.com/TYPO3-Documentation/Changelog-To-Doc/issues/934 Releases: main --------- Co-authored-by: Garvin Hicking Co-authored-by: Stefan Frömken --- Documentation/PageTsconfig/Mod/WebList.rst | 56 +++++++++++++++++++ .../Mod/_WebList/_downloadPresets.tsconfig | 14 +++++ .../_WebList/_downloadPresetsUser.tsconfig | 13 +++++ 3 files changed, 83 insertions(+) create mode 100644 Documentation/PageTsconfig/Mod/_WebList/_downloadPresets.tsconfig create mode 100644 Documentation/PageTsconfig/Mod/_WebList/_downloadPresetsUser.tsconfig diff --git a/Documentation/PageTsconfig/Mod/WebList.rst b/Documentation/PageTsconfig/Mod/WebList.rst index 8bfc046e..a8a7091b 100644 --- a/Documentation/PageTsconfig/Mod/WebList.rst +++ b/Documentation/PageTsconfig/Mod/WebList.rst @@ -200,6 +200,62 @@ Example: Hide the column selector mod.web_list.displayColumnSelector = 0 +.. _pageTsConfigWebList-downloadPresets: + +downloadPresets +=============== + +.. confval:: downloadPresets.[table] + :name: mod-web-list-downloadPresets + :type: array of presets + + .. versionadded:: 13.2 + A new function has been introduced that makes it possible to select the data columns + to be exported from a list of configurable presets. + + This property adds presets of preselected fields to the download area in + the :guilabel:`Web > List` backend module. + + Those presets can be configured via page TSconfig, and can also be + overridden via user TSconfig (for example, to expand certain presets + only to specific users). + + Each entry of :typoscript:`mod.web_list.downloadPresets` + defines the table name on the first level, followed by + any number of presets. + + Each preset contains a :typoscript:`label` (the displayed name of the preset, + which can be a locallang key), a comma-separated list of each column that + should be included in the export as :typoscript:`columns` and optionally + an :typoscript:`identifier`. In case :typoscript:`identifier` is not provided, + the identifier is generated as hash of the :typoscript:`label` and + :typoscript:`columns`. + + Since any table can be configured for a preset, any extension + can deliver a defined set of presets through the + :file:`EXT:my_extension/Configuration/page.tsconfig` file and + their table name(s). + + .. todo:: Link event after it is merged + + Additionally, the list of presets can be manipulated via the PSR-14 event + :php:`BeforeRecordDownloadPresetsAreDisplayedEvent`. + +.. _pageTsConfigWebList-downloadPresets-example: + +Example: Create download presets for table page +----------------------------------------------- + +.. literalinclude:: _WebList/_downloadPresets.tsconfig + :caption: EXT:my_extension/Configuration/page.tsconfig + +This can be manipulated with user TSconfig by adding the :typoscript:`page.` +prefix. User TSconfig is loaded after page TSconfig, so you can overwrite +the existing default settings using the same TypoScript path. + +.. literalinclude:: _WebList/_downloadPresets.tsconfig + :caption: EXT:my_extension/Configuration/user.tsconfig + .. index:: enableClipBoard Buttons; Show clipboard diff --git a/Documentation/PageTsconfig/Mod/_WebList/_downloadPresets.tsconfig b/Documentation/PageTsconfig/Mod/_WebList/_downloadPresets.tsconfig new file mode 100644 index 00000000..2f27fe12 --- /dev/null +++ b/Documentation/PageTsconfig/Mod/_WebList/_downloadPresets.tsconfig @@ -0,0 +1,14 @@ +mod.web_list.downloadPresets { + pages { + minimum { + label = Quick overview + columns = uid, title, crdate, slug + } + + fullExport { + identifier = uid-title + label = LLL:EXT:myext/Resources/Private/Language/locallang.xlf:preset2.label + columns = uid, title + } + } +} \ No newline at end of file diff --git a/Documentation/PageTsconfig/Mod/_WebList/_downloadPresetsUser.tsconfig b/Documentation/PageTsconfig/Mod/_WebList/_downloadPresetsUser.tsconfig new file mode 100644 index 00000000..5d7c7ad1 --- /dev/null +++ b/Documentation/PageTsconfig/Mod/_WebList/_downloadPresetsUser.tsconfig @@ -0,0 +1,13 @@ +page.mod.web_list.downloadPresets { + pages { + minimum { + label = Quick overview (customized) + columns = uid, title, crdate, slug + } + + fullExport { + label = Short with URL + columns = uid, title, slug + } + } +} \ No newline at end of file