Project

General

Profile

Actions

Bug #97170

closed

Make backend preview work in workspaces

Added by Francois Suter about 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
Start date:
2022-03-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

It is possible to define a preview configuration for any type of record in the TYPO3 backend, using a Page TSconfig configuration like:

TCEMAIN.preview {
    tx_workspaceextensiontest_foo {
        previewPageId = xxx
        fieldToParameterMap {
            uid = tx_workspacepreviewtest_preview[uid]
        }
        additionalGetParameters {
            tx_workspacepreviewtest_preview.table = tx_workspaceextensiontest_foo
        }
    }
}

where xxx is the uid of a page where - most likely - a plugin will reside.

In workspaces, it is possible to define a page id where preview can happen for any record, using a Page TSconfig configuration like:

options.workspaces.previewPageId = xxx

This setting adds a "Preview" icon in the Workspaces module.

Unfortunately that workspace preview feature does not take the generic backend preview feature into account, which makes it impossible to pass the appropriate parameters to the plugin controller when previewing in a workspace. My proposal is to make \TYPO3\CMS\Workspaces\Preview\PreviewUriBuilder::createPreviewUriForElement() able to handle the generic backend preview configuration.

NOTE: the generic backend preview works fine in workspaces (i.e. when you hit the "View" button when editing a record).


Files

workspace_preview.png (47.4 KB) workspace_preview.png Francois Suter, 2022-03-11 08:13
workspace_preview_test.zip (55.8 KB) workspace_preview_test.zip Francois Suter, 2023-01-27 11:33
Actions

Also available in: Atom PDF