Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
resource: '../Classes/*'
B13\Backendpreviews\Hooks\BackendPreviewRenderer:
public: true
B13\Backendpreviews\Service\DatabaseRowService:
public: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would prefer to give the fileRepository as constructor arguments in the ContentPreview

-        $data = GeneralUtility::makeInstance(DatabaseRowService::class)->getAdditionalDataForView($record);
+        $fileRepository = GeneralUtility::makeInstance(FileRepository::class);
+        $data = GeneralUtility::makeInstance(DatabaseRowService::class, $fileRepository)->getAdditionalDataForView($record);

B13\Backendpreviews\Listener\PageContentPreviewRendering:
tags:
- name: event.listener
Expand Down
4 changes: 4 additions & 0 deletions Configuration/Sets/b13/page.tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ mod.web_layout.tt_content.preview.view {
partialRootPaths.0 = EXT:backendpreviews/Resources/Private/Partials
templateRootPaths.0 = EXT:backendpreviews/Resources/Private/Templates
}

[typo3.version < 14]
mod.web_layout.tt_content.preview.view.partialRootPaths.1 = EXT:backendpreviews/Resources/Private/PartialsLegacy
[END]
16 changes: 16 additions & 0 deletions Resources/Private/PartialsLegacy/Link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<html
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true"
>

<f:if condition="{link}">
<div class="b_link">
<span class="b_label">{f:translate(key: 'LLL:EXT:backendpreviews/Resources/Private/Language/locallang_db.xlf:link.label')}: </span>{linklabel}
({f:if(condition: '{f:uri.typolink(parameter: link, language: language)}', then: '{f:uri.typolink(parameter: link.url, language: language)}', else: link)})
<f:if condition="{config}">
[{f:translate(key: 'LLL:EXT:backendpreviews/Resources/Private/Language/locallang_db.xlf:link.config')}: {config}]
</f:if>
</div>
</f:if>

</html>