Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for fieldInformation and a hint to use description for default cases #791

Merged
merged 3 commits into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions Documentation/ColumnsConfig/CommonProperties/FieldInformation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,65 @@ fieldInformation
works identical to the "fieldWizard" property, no default configuration in the core exists (yet).
In contrast to "fieldWizard", HTML returned by fieldInformation is limited, see
:ref:`FormEngine docs <t3coreapi:FormEngine-Rendering-NodeExpansion>` for more details.

.. hint::

:php:`fieldInformation` is not implemented by default. Use :ref:`columns-properties-description`
to display general information below a fields title.

Example
=======

You can have a look at the extension `georgringer/news` in version 9.4 for an example:
https://github.com/georgringer/news/blob/9.4.0/Configuration/TCA/tx_news_domain_model_news.php#L521
(with `georgringer/news ^10.0` this was moved to a non-public extension).

.. code-block:: php
:caption: EXT:news/Configuration/TCA/tx_news_domain_model_news.php (Excerpt)

'tags' => [
'config' => [
// ...
'fieldInformation' => [
'tagInformation' => [
'renderType' => 'NewsStaticText',
'options' => [
'labels' => [
[
'label' => '',
'bold' => true,
'italic' => true,
],
],
],
],
],
]


The implementation can be found in https://github.com/georgringer/news/blob/9.4.0/Classes/Backend/FieldInformation/StaticText.php:

.. code-block:: php

<?php

declare(strict_types=1);

namespace GeorgRinger\News\Backend\FieldInformation;

use TYPO3\CMS\Backend\Form\AbstractNode;

class StaticText extends AbstractNode
{
public function render(): array
{
// ...

return [
'requireJsModules' => [
'TYPO3/CMS/News/TagSuggestWizard',
],
'html' => '...>',
];
}
}
Loading