Skip to content

Commit

Permalink
TASK: Add tests for content_blocks in backend layout
Browse files Browse the repository at this point in the history
  • Loading branch information
d-g-codappix committed Jun 12, 2024
1 parent 57307e1 commit bf463ca
Show file tree
Hide file tree
Showing 18 changed files with 390 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
mod.web_layout.BackendLayouts {
MainTemplate {
title = MainTemplate
name = MainTemplate
config {
backend_layout {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = Main Content
colPos = 0
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
tt_content.codappix_image {
dataProcessing {
100 = Codappix\ResponsiveImages\DataProcessing\ResponsiveImagesProcessor
100 {
fieldName = image
}
}
}

plugin.tx_responsiveimages {
settings {
contentelements {
codappix_image {
image {
multiplier {
xs = 1
sm = 1
md = 1
lg = 1
xl = 0.5
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
tt_content.codappix_imagefixedwidth {
dataProcessing {
100 = Codappix\ResponsiveImages\DataProcessing\ResponsiveImagesProcessor
100 {
fieldName = image
}
}
}

plugin.tx_responsiveimages {
settings {
contentelements {
codappix_imagefixedwidth {
image {
sizes {
xs = 600
sm = 900
md = 1200
lg = 1600
xl = 1600
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugin.tx_responsiveimages {
settings {
breakpoints {
xs {
cropVariant = mobile
max = 480
}
sm {
cropVariant = mobile
max = 767
}
md {
cropVariant = tablet
max = 991
}
lg {
cropVariant = default
max = 1479
}
xl {
cropVariant = large
min = 1480
}
}

backendlayouts {
pagets__MainTemplate {
sizes {
xs = 734
sm = 704
md = 924
lg = 1124
xl = 1124
}
columns {
0 {
multiplier {
xs = 1
sm = 1
md = 1
lg = 1
xl = 1
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
page = PAGE
page {
10 < styles.content.get

config {
disableAllHeaderCode = 1
admPanel = 0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:content_blocks_example/Configuration/TypoScript/ContentElements/">
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:content_blocks_example/Configuration/TypoScript/Extensions/">
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: codappix/image-fixed-width
title: codappix/image-fixed-width
description: 'Description for Content Element codappix/image-fixed-width'
group: common
prefixFields: true
prefixType: full
fields:
-
identifier: image
useExistingField: true
type: File
allowed: common-image-types
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:spaceless>
<f:for each="{responsiveImages}" as="image">
<f:if condition="{image}"><f:for each="{image.sizes}" as="size" iteration="sizeIterator">{size.breakpoint.cropVariant} {size.size} {size.breakpoint.mediaQuery}</f:for></f:if>
</f:for>
</f:spaceless>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file datatype="plaintext" original="Labels.xlf" source-language="en" date="2024-04-16T13:20:57+00:00" product-name="codappix/image-fixed-width">
<header/>
<body>
<trans-unit id="title" resname="title">
<source>codappix/image-fixed-width</source>
</trans-unit>
<trans-unit id="description" resname="description">
<source>Description for Content Element codappix/image-fixed-width</source>
</trans-unit>
<trans-unit id="image.label" resname="image.label">
<source>Custom image label</source>
</trans-unit>
</body>
</file>
</xliff>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: codappix/image
title: codappix/image
description: 'Description for Content Element codappix/image'
group: common
prefixFields: true
prefixType: full
fields:
-
identifier: image
useExistingField: true
type: File
allowed: common-image-types
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:spaceless>
<f:for each="{responsiveImages}" as="image">
<f:if condition="{image}"><f:for each="{image.sizes}" as="size" iteration="sizeIterator">{size.breakpoint.cropVariant} {size.size} {size.breakpoint.mediaQuery}</f:for></f:if>
</f:for>
</f:spaceless>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file datatype="plaintext" original="Labels.xlf" source-language="en" date="2024-04-16T13:20:57+00:00" product-name="codappix/image">
<header/>
<body>
<trans-unit id="title" resname="title">
<source>codappix/image</source>
</trans-unit>
<trans-unit id="description" resname="description">
<source>Description for Content Element codappix/image</source>
</trans-unit>
<trans-unit id="image.label" resname="image.label">
<source>Custom image label</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

return [
'tt_content' => [
1 => [
'uid' => '1',
'pid' => '2',
'hidden' => '0',
'sorting' => '1',
'CType' => 'codappix_image',
'header' => 'codappix_image',
'deleted' => '0',
'starttime' => '0',
'endtime' => '0',
'colPos' => '0',
'sys_language_uid' => '0',
'image' => '1',
],
],
'sys_file_reference' => [
0 => [
'uid' => '1',
'pid' => '2',
'uid_local' => '1',
'uid_foreign' => '1',
'tablenames' => 'tt_content',
'fieldname' => 'image',
],
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

return [
'tt_content' => [
1 => [
'uid' => '1',
'pid' => '2',
'hidden' => '0',
'sorting' => '1',
'CType' => 'codappix_imagefixedwidth',
'header' => 'codappix_imagefixedwidth',
'deleted' => '0',
'starttime' => '0',
'endtime' => '0',
'colPos' => '0',
'sys_language_uid' => '0',
'image' => '1',
],
],
'sys_file_reference' => [
0 => [
'uid' => '1',
'pid' => '2',
'uid_local' => '1',
'uid_foreign' => '1',
'tablenames' => 'tt_content',
'fieldname' => 'image',
],
],
];
15 changes: 15 additions & 0 deletions Tests/Fixtures/content_blocks_example/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "codappix/content_blocks_example",
"description": "Add a content blocks example for frontend tests",
"type": "typo3-cms-extension",
"license": "GPL-2.0-or-later",
"require": {
"typo3/cms-core": "*",
"codappix/typo3-responsive-images": "*"
},
"extra": {
"typo3/cms": {
"extension-key": "content_blocks_example"
}
}
}
Loading

0 comments on commit bf463ca

Please sign in to comment.