Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
[FEATURE] Add record list download presets
Browse files Browse the repository at this point in the history
  • Loading branch information
linawolf committed Jun 20, 2024
1 parent c53dbfa commit 202c16c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
56 changes: 56 additions & 0 deletions Documentation/PageTsconfig/Mod/WebList.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 feature has been introduced, adding the ability to pick the exported
data columns 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
a :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 event
`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
existing keys or replace the whole list of keys:

.. literalinclude:: _WebList/_downloadPresets.tsconfig
:caption: EXT:my_extension/Configuration/user.tsconfig

.. index::
enableClipBoard
Buttons; Show clipboard
Expand Down
14 changes: 14 additions & 0 deletions Documentation/PageTsconfig/Mod/_WebList/_downloadPresets.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mod.web_list.downloadPresets {
pages {
10 {
label = Quick overview
columns = uid, title, crdate, slug
}

20 {
identifier = LLL:EXT:myext/Resources/Private/Language/locallang.xlf:preset2.label
label = UID and titles only
columns = uid, title
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
page.mod.web_list.downloadPresets {
pages {
10 {
label = Quick overview (customized)
columns = uid, title, crdate, slug
}

30 {
label = Short with URL
columns = uid, title, slug
}
}
}

0 comments on commit 202c16c

Please sign in to comment.