Feature #88921

New Event in the PageLayoutView Class to enrich Content into the Columns in the BackendLayout

Added by Volker Kemeter 4 months ago. Updated 4 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2019-08-05
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

what
this event can be triggered to enrich content into any column in the BackendLayout. This content will be shown after the last content element. You can use business logics to show content in specific columns. e.g. for displaying content only in columns without any colpos.

why
i needed that to display records from another table in a column with no colpos. the editor is able to see records in exact that place, where the content is shown in the website.

usage

register the service in the Services.yaml file

  # Register an Event for adding Content into BackendLayout Columns
  YOUR\NameSpace\Backend\View\PageLayoutViewDrawEmptyColposContent:
    tags:
      - { name: event.listener,
          identifier: 'emptyColposListener',
          event:  TYPO3\CMS\Backend\View\Event\AfterGeneratedColposMarkupEvent }

add your own service class

you can use in your own class as much business logic as you want. e.g. fetch data from a rest service and place it in the colpos of your needs.

class PageLayoutViewDrawEmptyColposContent
{
    public function __invoke(AfterGeneratedColposMarkupEvent $event): void
    {
        if (!isset($event->getColumnConfig()['colPos'])) {
            $content = <<<EOD
                <div data-colpos="1" data-language-uid="0" class="t3-page-ce-wrapper">
                    <div class="t3-page-ce">
                        <div class="t3-page-ce-header">Empty Colpos</div>
                        <div class="t3-page-ce-body">
                            <div class="t3-page-ce-body-inner">
                                <div class="row">
                                    <div class="col-xs-12">
                                        This column has no "colPos". This is only for display Purposes. You can now fetch Data from somewhere else and display it right in this position.  
                                    </div>
                                </div>
                            </div>

                            <div class="t3-page-ce-footer">
                                <div class="t3-page-ce-info">KTHXBYE!</div>
                            </div>
                        </div>
                    </div>
                </div>      
EOD;

            $event->setContent($content);
        }
    }
}

History

#1 Updated by Gerrit Code Review 4 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61442

#2 Updated by Gerrit Code Review 4 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61442

#3 Updated by Daniel Siepmann 4 months ago

This is a must have. With a very small change to the core (introducing a new event / hook) the following will become possible:

Integrators / Developers can provide a custom preview within colpos. They are able to enrich the user experience of editors and therefore improve the overall experience of TYPO3.

E.g. one could display some external data that is provided within an colpos through a web service. This allows to make the Pageview actually a page view. Also information from page properties might be displayed, and also editable through ViewHelper linking to the edit record.

#4 Updated by Gerrit Code Review 4 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61442

#5 Updated by Gerrit Code Review 4 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61442

#6 Updated by Gerrit Code Review 4 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61442

Also available in: Atom PDF