From b3315cdd2cdbd0bcab70d8f5c5a0874b21ac242a Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Wed, 28 Sep 2022 14:14:00 +0200 Subject: [PATCH] New: Add preview mode --- Configuration/Settings.Neos.yaml | 13 +++++++++++++ Resources/Private/Fusion/Root.fusion | 15 +++++++++++++++ Resources/Private/Translations/de/Main.xlf | 16 ++++++++++++++++ Resources/Private/Translations/en/Main.xlf | 14 ++++++++++++++ composer.json | 3 ++- 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Resources/Private/Translations/de/Main.xlf create mode 100644 Resources/Private/Translations/en/Main.xlf diff --git a/Configuration/Settings.Neos.yaml b/Configuration/Settings.Neos.yaml index 041169f..a99ddcf 100644 --- a/Configuration/Settings.Neos.yaml +++ b/Configuration/Settings.Neos.yaml @@ -3,6 +3,19 @@ Neos: fusion: autoInclude: 'Garagist.Plaintext': true + userInterface: + translation: + autoInclude: + Garagist.Plaintext: + - 'Main' + editPreviewModes: + plaintext: + isEditingMode: false + isPreviewMode: true + fusionRenderingPath: 'plaintext' + title: 'Garagist.Plaintext:Main:editPreviewMode' + width: 1024 + backgroundColor: '#eee' Fusion: defaultContext: 'Garagist.Plaintext': 'Garagist\Plaintext\Eel\PlaintextHelper' diff --git a/Resources/Private/Fusion/Root.fusion b/Resources/Private/Fusion/Root.fusion index 6880f22..7ad28d1 100644 --- a/Resources/Private/Fusion/Root.fusion +++ b/Resources/Private/Fusion/Root.fusion @@ -8,3 +8,18 @@ root { } @cache.entryIdentifier.plaintext = ${request.arguments.plaintext ? 'plaintext' : 'default'} } + +plaintext = Neos.Fusion:Case { + canRender { + condition = Neos.Fusion:CanRender { + type = ${node.nodeType.name + '.Plaintext'} + } + type = ${node.nodeType.name + '.Plaintext'} + } + notSet { + condition = true + renderer = Carbon.Notification:Document { + content = ${Translation.translate('editPreviewMode.noSet', 'Plaintext output is not configured for this page type', [], 'Main', 'Garagist.Plaintext')} + } + } +} diff --git a/Resources/Private/Translations/de/Main.xlf b/Resources/Private/Translations/de/Main.xlf new file mode 100644 index 0000000..3821f5e --- /dev/null +++ b/Resources/Private/Translations/de/Main.xlf @@ -0,0 +1,16 @@ + + + + + + Plaintext + Klartext + + + Plaintext output is not configured for this page type + Für diesen Seitentyp ist keine Klartextausgabe konfiguriert + + + + diff --git a/Resources/Private/Translations/en/Main.xlf b/Resources/Private/Translations/en/Main.xlf new file mode 100644 index 0000000..52f1b39 --- /dev/null +++ b/Resources/Private/Translations/en/Main.xlf @@ -0,0 +1,14 @@ + + + + + + Plaintext + + + Plaintext output is not configured for this page type + + + + diff --git a/composer.json b/composer.json index a206845..ba2114b 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,8 @@ "license": "GPL-3.0-or-later", "require": { "neos/neos": "^7.3 || ^8.0", - "ext-mbstring": "*" + "ext-mbstring": "*", + "carbon/notification": "^2.4" }, "authors": [ {