Developer
Overriding templates
plugin.tx_crgalerie.view {
templateRootPaths.20 = EXT:my_sitepackage/Resources/Private/Crgalerie/Templates/
partialRootPaths.20 = EXT:my_sitepackage/Resources/Private/Crgalerie/Partials/
}
Copied!
The template of a gallery is Partials/, of the
overview Templates/.
Variables of a gallery: galerie (gallery object), bilder (list with
datei, titel, beschreibung, credit), show
(0–3), darstellung, anzahl, sizes, sizes,
css, element, titel (2–6). In the overview:
galerien (with titel, erstes, anzahl) and
kachelstil.
ViewHelpers
Namespace Conrat\.
<crg:bild Quellen datei=" {…}" as="quellen"> - Provides
src,srcset,breite,hoehe,gross,Url gross,Breite grossandHoehe verhaeltnis. Arguments:breiten(thumbnail widths, default{0: 400, 1: 800, 2: 1200};srcis the middle one) andgross(longest side of the lightbox variant, default 2560;0= no own variant). {crg:zeilen Sizes (verhaeltnis: …, zeilenhoehe: 260, zeilenhoehe Mobil: 120)} sizesfor one image in the layout "Mosaic in rows" from its aspect ratio and the row heights (pixel values).
Markup contract for own gallery templates
galerie. (lightbox and "Show all") and the CSS rely on these
hooks – keep them when overriding Bilder.:
<f:includes CSS, PhotoSwipe andrender partial="Galerie/ Assets" arguments=" {css Einbinden: css Einbinden}" /> galerie.(js lightbox: 0omits lightbox CSS and script, as in the overview).data-on the container of a gallery (one lightbox per container).crg- galerie data-,crg- text- dialog -close,-zoom,-previous,-next,-erroron the container: translated lightbox texts..crg__withliste data-, containing onecrg- anzahl- start=" {anzahl Start}" .crg__per image.bild .crg__in the container: its text names the lightbox dialog.titel a.withcrg__ link href=",{quellen. gross Url}" data-andpswp- width data-;pswp- height data-if the thumbnail is cropped.cropped="true" [data-(withcrg- lightboxtext] hidden) in the same.crg__– shown as caption in the lightbox.figur [data-(withcrg- mehr] hidden) as the "Show all X photos" button.- Images after
anzahldelivered withStart hidden, plus the<noscript>stylesheetgalerie-. Do not use anoscript. css <style>element: TYPO3's Content Security Policy blocks it.
Development and tests
composer install
.Build/bin/phpstan analyse -c Build/phpstan.neon
typo3DatabaseDriver=pdo_sqlite .Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml
Copied!
The functional tests need ImageMagick or GraphicsMagick. Contributions are
welcome, see CONTRIBUTING. in the repository.