Created
April 23, 2024 05:12
-
-
Save slackero/a3d88890c2aa824c470f92d350f2f764 to your computer and use it in GitHub Desktop.
Typo3 bootstrap_package get the thumbnail image from the page details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" data-namespace-typo3-fluid="true"> | |
<f:if condition="{pageThumbnails}"> | |
<f:for each="{pageThumbnails}" as="thumbnail" iteration="iteration"> | |
<f:if condition="{iteration.isFirst}"> | |
<div class="container-border"> | |
<f:comment><f:image src="{thumbnail.data.uid}" treatIdAsReference="1" class="img-fluid" /></f:comment> | |
<v:media.image | |
src="{thumbnail.data.uid}" | |
treatIdAsReference="1" | |
alt="{thumbnail.data.alternative}" | |
class="img-fluid w-100 d-block" | |
srcset="320, 768, 990, 1200, 1920" | |
srcsetDefault="768" | |
/> | |
</div> | |
</f:if> | |
</f:for> | |
</f:if> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page.10.dataProcessing { | |
# Get the thumbnail image of the page if available (Typo3 12.4) | |
100 = database-query | |
// older versions might require (untested) | |
// 100 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor | |
100 { | |
table = sys_file_reference | |
as = pageThumbnails | |
// sys_file_reference.title, sys_file_reference.description, sys_file_reference.alternative, sys_file_reference.link, sys_file_reference.crop | |
selectFields = sys_file_reference.uid, sys_file_reference.uid_local, sys_file_reference.title, sys_file_reference.description, sys_file_reference.alternative, sys_file_reference.link | |
where = sys_file_reference.tablenames = 'pages' AND sys_file_reference.fieldname = 'thumbnail' | |
join = pages ON pages.uid = sys_file_reference.uid_foreign AND pages.thumbnail = 1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will need to have the extension VHS: Fluid ViewHelpers installed.