b224c3a97ff02664c994b3b3cb66ab056157dbe6
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 7.2 / Feature-66370-AddFlexiblePreviewUrlConfiguration.rst
1 ========================================================
2 Feature: #66370 - Add flexible Preview URL configuration
3 ========================================================
4
5 Description
6 ===========
7
8 It is now possible to configure the preview link generated for the save+view button in Backend.
9
10 This allows to have different preview URLs depending on the record type.
11
12 Common usecase is to have previews for blog or news records, but this feature now allows you to
13 define a different preview page for content elements as well, which might be handy if those are stored
14 in a sysfolder.
15
16
17 Impact
18 ======
19
20 New page TSconfig is introduced. The options are:
21
22 .. code-block:: typoscript
23
24 TCEMAIN.preview {
25 <table name> {
26 previewPageId = 123
27 useDefaultLanguageRecord = 0
28 fieldToParameterMap {
29 uid = tx_myext_pi1[showUid]
30 }
31 additionalGetParameters {
32 tx_myext_pi1[special] = HELLO
33 }
34 }
35 }
36
37 The ``previewPageId`` is the uid of the page to use for preview. If this setting is omitted the current page will be used.
38 If the current page is not a normal page, the root page will be chosen.
39
40 The ``useDefaultLanguageRecord`` defaults to ``1`` and ensures that translated records will use the uid of the default record
41 for the preview link. You may disable this, if your extension can deal with the uid of translated records.
42
43 The ``fieldToParameterMap`` is a mapping which allows you to select fields of the record to be included as GET-parameters in
44 the preview link. The key specifies the field name and the value specifies the GET-parameter name.
45
46 Finally ``additionalGetParameters`` allow you to add arbitrary GET-parameters and even override others.
47
48 Predefined GET-parameters
49 ^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 The Core automatically sets the ``no_cache`` and the ``L`` parameter. The language matches the language of the current record.
52 You may override each parameter by using the ``additionalGetParameters`` configuration option.